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
42 43 44 |
# File 'app/models/ecm/references/reference.rb', line 42 def self.localized joins(:category).where(ecm_references_categories: { locale: I18n.locale }) end |
.with_public_visibility ⇒ Object
46 47 48 |
# File 'app/models/ecm/references/reference.rb', line 46 def self.with_public_visibility published.localized end |
Instance Method Details
#preview_picture ⇒ Object
50 51 52 |
# File 'app/models/ecm/references/reference.rb', line 50 def preview_picture pictures.first end |
#preview_picture_image_url(style = nil) ⇒ Object
54 55 56 |
# File 'app/models/ecm/references/reference.rb', line 54 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
58 59 60 |
# File 'app/models/ecm/references/reference.rb', line 58 def to_s name end |