Album retractions

This commit is contained in:
ilya 2010-07-21 18:27:18 -07:00
parent 6b9a3fc518
commit a75dfb0201

View file

@ -19,6 +19,7 @@ class Album
before_destroy :destroy_photos
after_save :notify_people
before_destroy :propagate_retraction
def prev_photo(photo)
n_photo = self.photos.where(:created_at.lt => photo.created_at).sort(:created_at.desc).first
n_photo ? n_photo : self.photos.sort(:created_at.desc).first