Class: Ecm::References::Reference
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ecm::References::Reference
- Extended by:
- FriendlyId
- Includes:
- ActsAsPublished::ActiveRecord
- Defined in:
- app/models/ecm/references/reference.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.localized ⇒ Object
54 55 56 |
# File 'app/models/ecm/references/reference.rb', line 54 def self.localized joins(:category).where(ecm_references_categories: { locale: I18n.locale }) end |
.with_public_visibility ⇒ Object
58 59 60 |
# File 'app/models/ecm/references/reference.rb', line 58 def self.with_public_visibility published.localized end |
Instance Method Details
#preview_picture ⇒ Object
62 63 64 |
# File 'app/models/ecm/references/reference.rb', line 62 def preview_picture pictures.first end |
#preview_picture_image_url(style = nil) ⇒ Object
66 67 68 |
# File 'app/models/ecm/references/reference.rb', line 66 def preview_picture_image_url(style = nil) preview_picture.image.url(style) if preview_picture.respond_to?(:image) && preview_picture.image.respond_to?(:url) end |
#to_s ⇒ Object
70 71 72 |
# File 'app/models/ecm/references/reference.rb', line 70 def to_s name end |