Sha256: 2261c999a4789b7e4bdea4d8095795506940f1c226a942fadd91e5bbdee1fbf5
Contents?: true
Size: 604 Bytes
Versions: 15
Compression:
Stored size: 604 Bytes
Contents
module Gluttonberg class AssetCollection < ActiveRecord::Base self.table_name = "gb_asset_collections" has_and_belongs_to_many :assets, :class_name => "Asset" , :join_table => "gb_asset_collections_assets" validates_uniqueness_of :name validates_presence_of :name attr_accessible :name def images data = assets.find(:all , :include => :asset_type ) data.find_all{|d| d.category == "image"} end # this method is required for gallery form def name_with_number_of_images "#{name} (#{images.length} images)" end end end
Version data entries
15 entries across 15 versions & 1 rubygems