Class: Ecm::Pictures::Gallery
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ecm::Pictures::Gallery
- Extended by:
- FriendlyId
- Includes:
- ActsAsPublished::ActiveRecord
- Defined in:
- app/models/ecm/pictures/gallery.rb
Instance Method Summary collapse
- #display_code_for_erb ⇒ Object
- #human ⇒ Object
- #picture_images=(picture_images) ⇒ Object
- #preview_picture ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#display_code_for_erb ⇒ Object
41 42 43 |
# File 'app/models/ecm/pictures/gallery.rb', line 41 def display_code_for_erb "<%= render_picture_gallery '#{name}' %>" end |
#human ⇒ Object
56 57 58 |
# File 'app/models/ecm/pictures/gallery.rb', line 56 def human name end |
#picture_images=(picture_images) ⇒ Object
45 46 47 48 49 50 |
# File 'app/models/ecm/pictures/gallery.rb', line 45 def picture_images=(picture_images) picture_images.each do |image| next if image.respond_to?(:empty?) && image.empty? pictures.build(image: image) end end |
#preview_picture ⇒ Object
60 61 62 |
# File 'app/models/ecm/pictures/gallery.rb', line 60 def preview_picture pictures.published.first end |
#to_s ⇒ Object
52 53 54 |
# File 'app/models/ecm/pictures/gallery.rb', line 52 def to_s name end |