mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Rails 5 introduced this new class to confine application-specific monkey patches to our models only, and not leak into other libraries using ActiveRecord::Base. https://bigbinary.com/blog/application-record-in-rails-5
13 lines
362 B
Ruby
13 lines
362 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Spree
|
|
class OptionValue < ApplicationRecord
|
|
belongs_to :option_type
|
|
acts_as_list scope: :option_type
|
|
has_and_belongs_to_many :variants, join_table: 'spree_option_values_variants',
|
|
class_name: "Spree::Variant"
|
|
|
|
validates :name, :presentation, presence: true
|
|
end
|
|
end
|