Sha256: 086d59c97d7a669d40d22692f0ea7e5af3a62849dfdf2aa0c2af882b3bad8cb9

Contents?: true

Size: 417 Bytes

Versions: 1

Compression:

Stored size: 417 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

    scope :ordered, :include => :option, :order => "options.position ASC, option_values.position ASC"

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
piggybak_variants-0.0.5 app/models/piggybak_variants/option_value.rb