Files
openfoodnetwork/app/models/spree/property.rb

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