Sha256: 6641c9b35cb4cac94b14e6efd4c9f5ff46726de886bac110aaccb8ed5807e026
Contents?: true
Size: 733 Bytes
Versions: 3
Compression:
Stored size: 733 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 def self.has_albums select("refinery_photo_gallery_collections.*").uniq. joins(:collection_albums). order('created_at DESC, title ASC') end =begin def to_param "#{id}-#{title.parameterize}" end =end end end end
Version data entries
3 entries across 3 versions & 1 rubygems