Sha256: e8725ab9b73fad4ad3a933d2af8afef73d71cb03208820bb265e4a97c7397709
Contents?: true
Size: 565 Bytes
Versions: 9
Compression:
Stored size: 565 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 self.whitelisted_ransackable_attributes = ['presentation'] private def touch_all_products products.update_all(updated_at: Time.current) end end end
Version data entries
9 entries across 9 versions & 1 rubygems