Sha256: a024fc8fb37b78076fc09da199e57a1e2c76451884bd07916bab06160f8cd47f
Contents?: true
Size: 435 Bytes
Versions: 13
Compression:
Stored size: 435 Bytes
Contents
class Gallery < ActiveRecord::Base include Forge::Reorderable has_many :photos accepts_nested_attributes_for :photos, :allow_destroy => true, :reject_if => lambda { |p| p[:file_asset_id].blank? && p[:id].blank? } validates_presence_of :title validates_uniqueness_of :title default_scope :order => 'galleries.list_order' def self.find_with_photos(id) includes(:photos).order('photos.list_order').find(id) end end
Version data entries
13 entries across 13 versions & 1 rubygems