Sha256: 3e30116ba46d80256aeefb11a5f5d0c5b772eb0936f4a0e9ab5a491f683cb37b

Contents?: true

Size: 358 Bytes

Versions: 2

Compression:

Stored size: 358 Bytes

Contents

module PiggybakVariants
  class OptionValue < ActiveRecord::Base
    self.table_name = "option_values"

    attr_accessible :name, :position
    has_and_belongs_to_many :variants
    belongs_to :option, :inverse_of => :option_values

    default_scope :order => "position ASC"

    def admin_label
      "#{self.option.name}: #{self.name}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
piggybak_variants-0.0.2 app/models/piggybak_variants/option_value.rb
piggybak_variants-0.0.1 app/models/piggybak_variants/option_value.rb