Clase para los álbums de la fototeca
# File app/models/album.rb, line 100 def self.categories Tree.find_albums_tree ? Tree.find_albums_tree.categories.roots : [] end
para poder reusar /documents/_share
# File app/models/album.rb, line 91 def body "" end
Foto de portada para este album
# File app/models/album.rb, line 56 def cover_aphoto album_photos.find_by_cover_photo(true) || album_photos.first end
# File app/models/album.rb, line 60 def cover_photo cover_aphoto.photo if cover_aphoto end
# File app/models/album.rb, line 64 def first_photo self.photos.find(:first, :order => "date_time_original") end
Determina si el álbum se muestra en Irekia. Sólo relevante para la busqueda
# File app/models/album.rb, line 80 def is_public? !draft? # true end
# File app/models/album.rb, line 68 def last_photo self.photos.find(:first, :order => "date_time_original DESC") end
Obtener departamentos del album a partir de los tags
# File app/models/album.rb, line 96 def organization Department.find(:first, :conditions => {:tag_name => self.tags.private.map(&:name)}) end
# File app/models/album.rb, line 85 def published? !draft? end
# File app/models/album.rb, line 72 def published_at self.updated_at end