mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
18 lines
373 B
Ruby
18 lines
373 B
Ruby
module Spree
|
|
class Property < ActiveRecord::Base
|
|
has_many :product_properties, dependent: :destroy
|
|
has_many :products, through: :product_properties
|
|
has_many :producer_properties
|
|
|
|
attr_accessible :name, :presentation
|
|
|
|
validates :name, :presentation, presence: true
|
|
|
|
scope :sorted, -> { order(:name) }
|
|
|
|
def property
|
|
self
|
|
end
|
|
end
|
|
end
|