class BioEdition

Constants

ATTACHMENT_METADATA_FIELDS
ATTACHMENT_TYPES

Public Instance Methods

cv() click to toggle source
# File lib/buweb/bio_edition.rb, line 44
def cv
  attachment if attachment.present? && attachment.metadata[:type] == 'cv'
end
cv_url() click to toggle source
# File lib/buweb/bio_edition.rb, line 48
def cv_url
  cv.try(:attachment).try(:url)
end

Private Instance Methods

set_edition_fields() click to toggle source

Edition requires a title and slug so set it from the person

# File lib/buweb/bio_edition.rb, line 55
def set_edition_fields
  unless person.nil?
    self.title ||= person.name
    set_slug
  end
end
set_slug() click to toggle source
# File lib/buweb/bio_edition.rb, line 62
def set_slug
  if self.person.slug.present?
    self.slug = self.person.slug
  elsif title?
    self.slug = title.parameterize
  end
end