Files
openfoodnetwork/app/models/spree/property.rb
2023-10-06 10:58:49 +09:00

18 lines
382 B
Ruby

# frozen_string_literal: true
module Spree
class Property < ApplicationRecord
has_many :product_properties, dependent: :destroy
has_many :products, through: :product_properties
has_many :producer_properties, dependent: :destroy
validates :name, :presentation, presence: true
scope :sorted, -> { order(:name) }
def property
self
end
end
end