Sha256: c5840e20ca8c15956a09ae2919903ecb3f4d2ca7eb498f6eb2b81999446e8a2d
Contents?: true
Size: 579 Bytes
Versions: 22
Compression:
Stored size: 579 Bytes
Contents
class Property < ActiveRecord::Base has_and_belongs_to_many :prototypes has_many :product_properties, :dependent => :destroy, :attributes => true has_many :products, :through => :product_properties validates_presence_of :name, :presentation named_scope :sorted, :order => :name def self.find_all_by_prototype(prototype) id = prototype if prototype.class == Prototype id = prototype.id end find(:all, :conditions => [ 'prototype_id = ?', id ], :joins => 'left join properties_prototypes on property_id = properties.id') end end
Version data entries
22 entries across 22 versions & 3 rubygems