Sha256: cbff658cc5c44bded85d4a86ea7af7fcb32598cd2ba6aff397865570a03b39a7
Contents?: true
Size: 504 Bytes
Versions: 63
Compression:
Stored size: 504 Bytes
Contents
# frozen_string_literal: true module Spree class Property < Spree::Base 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 = %w[name] private def touch_all_products products.update_all(updated_at: Time.current) end end end
Version data entries
63 entries across 63 versions & 1 rubygems