Sha256: 8acaebeff7c2fa454128c5bfdca1e3332f51c48ee8b6c73585fde7624607435c
Contents?: true
Size: 501 Bytes
Versions: 39
Compression:
Stored size: 501 Bytes
Contents
module Spree class Property < Spree::Base has_and_belongs_to_many :prototypes, join_table: 'spree_properties_prototypes' has_many :product_properties, dependent: :delete_all, inverse_of: :property has_many :products, through: :product_properties validates :name, :presentation, presence: true scope :sorted, -> { order(:name) } after_touch :touch_all_products private def touch_all_products products.update_all(updated_at: Time.current) end end end
Version data entries
39 entries across 39 versions & 2 rubygems