Sha256: 2799e80537df64a1d22a79d9aad55cf40f0a1ed28b5f1f4fe10177ea35656d23
Contents?: true
Size: 527 Bytes
Versions: 29
Compression:
Stored size: 527 Bytes
Contents
class Property < ActiveRecord::Base has_and_belongs_to_many :prototypes has_many :product_properties, :dependent => :destroy has_many :products, :through => :product_properties validates :name, :presentation, :presence => true scope :sorted, lambda { order(:name) } def self.find_all_by_prototype(prototype) id = prototype if prototype.class == Prototype id = prototype.id end joins('left join properties_prototypes on property_id = properties.id').where('prototype_id = ?', id) end end
Version data entries
29 entries across 29 versions & 6 rubygems