Module: HasImages::InstanceMethods
- Defined in:
- lib/has_images.rb
Instance Method Summary collapse
- #create_image_by_url(url, image_type = nil) ⇒ Object
- #find_or_create_gallery(name) ⇒ Object
- #galleries? ⇒ Boolean
-
#has_more_images? ⇒ Boolean
does this model have any images, that are not set as avatar?.
-
#images_without_gallery ⇒ Object
returns all images without gallery.
-
#more_images ⇒ Object
returns all images that are not set as avatar.
Instance Method Details
#create_image_by_url(url, image_type = nil) ⇒ Object
59 60 61 |
# File 'lib/has_images.rb', line 59 def create_image_by_url(url, image_type = nil) images.create!(:file_url => url, :image_type => image_type) end |
#find_or_create_gallery(name) ⇒ Object
54 55 56 |
# File 'lib/has_images.rb', line 54 def find_or_create_gallery(name) galleries.find_or_create_by_name(name) end |
#galleries? ⇒ Boolean
50 51 52 |
# File 'lib/has_images.rb', line 50 def galleries? galleries.any? end |
#has_more_images? ⇒ Boolean
does this model have any images, that are not set as avatar?
46 47 48 |
# File 'lib/has_images.rb', line 46 def has_more_images? images.not_avatar.any? end |
#images_without_gallery ⇒ Object
returns all images without gallery
41 42 43 |
# File 'lib/has_images.rb', line 41 def images_without_gallery images.without_gallery end |
#more_images ⇒ Object
returns all images that are not set as avatar
36 37 38 |
# File 'lib/has_images.rb', line 36 def more_images images.not_avatar end |