Sha256: 8235fe76f0f5fbc7e635d7a4d3aa79a8230318fc11a620c28b53160f5eca29c2
Contents?: true
Size: 943 Bytes
Versions: 29
Compression:
Stored size: 943 Bytes
Contents
module Comee module Core class ClientPrice < Price belongs_to :client belongs_to :previous_price, class_name: "Comee::Core::ClientPrice", optional: true belongs_to :next_price, class_name: "Comee::Core::ClientPrice", optional: true validates :price, presence: true validates :price, numericality: {greater_than: 0} validates :discount, presence: true, numericality: {greater_than_or_equal_to: 0, less_than_or_equal_to: 100} validates :product_id, uniqueness: {scope: %i[client_id previous_price_id next_price_id status]} def self.ransackable_attributes(_auth_object = nil) %w[ valid_from valid_to price status product_id client_id previous_price_id next_price_id ] end def self.ransackable_associations(_auth_object = nil) %w[product client] end end end end
Version data entries
29 entries across 29 versions & 1 rubygems