Sha256: 5b655d198d48b2ae37c7d0fc526e805c5e9b397764f60c12a280bd1cb1b27407
Contents?: true
Size: 644 Bytes
Versions: 136
Compression:
Stored size: 644 Bytes
Contents
module Spree class Property < Spree::Base has_many :property_prototypes, class_name: 'Spree::PropertyPrototype' has_many :prototypes, through: :property_prototypes, class_name: 'Spree::Prototype' 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
136 entries across 136 versions & 2 rubygems