Sha256: 39ee5a213b35528dcc2a3d25162ef8dc283ec0e129c0565ceca6ce97b9bb2abf

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 Bytes

Contents

module Gemgento
  module Bundle

    # @author Gemgento LLC
    class Option < ActiveRecord::Base
      include Gemgento::ProductTouches

      enum input_type: { selection: 0, radio: 1, checkbox: 2, multi: 3 }

      belongs_to :product, class_name: 'Gemgento::Product'

      has_many :items, class_name: 'Gemgento::Bundle::Item', dependent: :destroy, foreign_key: :bundle_option_id
      has_many :products, through: :items, class_name: 'Gemgento::Product'

      validates :product, presence: true

      default_scope -> { order :position }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemgento-2.8.0 app/models/gemgento/bundle/option.rb