Sha256: 7d08abdbbfb09dbf0dd60348211545be1a97de17377c731b95855fd2efcbd23f

Contents?: true

Size: 421 Bytes

Versions: 6

Compression:

Stored size: 421 Bytes

Contents

class ShopGroup < ActiveRecord::Base
    
  belongs_to  :created_by,  :class_name => 'User'
  belongs_to  :updated_by,  :class_name => 'User'
  
  has_many :groupings,  :class_name => 'ShopGrouping',  :foreign_key  => :group_id
  has_many :products,   :class_name => 'ShopProduct',   :through      => :groupings
  
  validates_presence_of :name
  
  def available_products
    ShopProduct.all - self.products
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
radiant-shop-extension-0.11.6 app/models/shop_group.rb
radiant-shop-extension-0.11.5 app/models/shop_group.rb
radiant-shop-extension-0.11.4 app/models/shop_group.rb
radiant-shop-extension-0.11.3 app/models/shop_group.rb
radiant-shop-extension-0.11.1 app/models/shop_group.rb
radiant-shop-extension-0.11.0 app/models/shop_group.rb