Class: SpudPhotoAlbum

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/spud_photo_album.rb

Instance Method Summary collapse

Instance Method Details

#photos_availableObject



24
25
26
27
28
29
30
# File 'app/models/spud_photo_album.rb', line 24

def photos_available
  if photo_ids.any?
    SpudPhoto.where('id not in (?)', photo_ids)
  else
    SpudPhoto.all
  end
end

#top_photo_url(style) ⇒ Object



20
21
22
# File 'app/models/spud_photo_album.rb', line 20

def top_photo_url(style)
  return photos.first.photo.url(style) unless photos.empty?
end