Sha256: f1bbb8d7fdecc383fa74e96530f36335e92292a2e804df95fe18c974ea4430bc

Contents?: true

Size: 487 Bytes

Versions: 1

Compression:

Stored size: 487 Bytes

Contents

class Plugins::Ecommerce::Attribute < ActiveRecord::Base
  self.table_name='plugins_ecommerce_attributes'
  belongs_to :site
  has_many :values, class_name: 'Plugins::Ecommerce::Attribute', foreign_key: :parent_id, dependent: :destroy
  belongs_to :product_attribute, class_name: 'Plugins::Ecommerce::Attribute', foreign_key: :parent_id
  scope :only_group, ->{ where(parent_id: nil) }
  scope :only_value, ->{ where.not(parent_id: nil) }
  default_scope ->{ order(position: :ASC) }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
camaleon_ecommerce-1.2 app/models/plugins/ecommerce/attribute.rb