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



27
28
29
30
31
32
33
# File 'app/models/spud_photo_album.rb', line 27

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

#top_photo_url(style) ⇒ Object



21
22
23
24
25
# File 'app/models/spud_photo_album.rb', line 21

def top_photo_url(style)
  if photos.length > 0
    return photos.first.photo.url(style)
  end
end