mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +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
11 lines
298 B
Ruby
11 lines
298 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Spree
|
|
class ShippingCategory < ApplicationRecord
|
|
validates :name, presence: true
|
|
has_many :products
|
|
has_many :shipping_method_categories, inverse_of: :shipping_method
|
|
has_many :shipping_methods, through: :shipping_method_categories
|
|
end
|
|
end
|