Class: Ecm::Pictures::Gallery
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ecm::Pictures::Gallery
- Extended by:
- FriendlyId
- 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
34 35 36 |
# File 'app/models/ecm/pictures/gallery.rb', line 34 def display_code_for_erb "<%= render_picture_gallery '#{name}' %>" end |
#human ⇒ Object
49 50 51 |
# File 'app/models/ecm/pictures/gallery.rb', line 49 def human name end |
#picture_images=(picture_images) ⇒ Object
38 39 40 41 42 43 |
# File 'app/models/ecm/pictures/gallery.rb', line 38 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
53 54 55 |
# File 'app/models/ecm/pictures/gallery.rb', line 53 def preview_picture pictures.first end |
#to_s ⇒ Object
45 46 47 |
# File 'app/models/ecm/pictures/gallery.rb', line 45 def to_s name end |