Sha256: c57c1ecc61267d57ea32caab32c0b306fb25994944e3943b38b1baee2dbd7eca
Contents?: true
Size: 738 Bytes
Versions: 4
Compression:
Stored size: 738 Bytes
Contents
module Refinery module PhotoGallery class Collection < ActiveRecord::Base has_many :collection_albums has_many :albums, :through => :collection_albums #TODO Allow to remove collection only if no album belongs to it attr_accessible :title, :description validates :title, :presence => true acts_as_indexed :fields => [:title, :description] self.per_page = Refinery::PhotoGallery.collections_per_page scope :has_albums, lambda { select("refinery_photo_gallery_collections.*").uniq. joins(:collection_albums). order('created_at DESC, title ASC') } =begin def to_param "#{id}-#{title.parameterize}" end =end end end end
Version data entries
4 entries across 4 versions & 2 rubygems