Sha256: 871c247ca46b9ec38475b7fb6f8ac337fe58f41713cbdcc25b2fcc7b6dca32f6
Contents?: true
Size: 1.07 KB
Versions: 57
Compression:
Stored size: 1.07 KB
Contents
module Comee module Core class Client < ApplicationRecord belongs_to :user, optional: true belongs_to :parent, class_name: "Comee::Core::Client", optional: true belongs_to :country, -> { where(lookup_type: :country) }, class_name: "Comee::Core::Lookup", optional: true belongs_to :currency, optional: true has_and_belongs_to_many :contacts, join_table: :comee_core_clients_contacts has_and_belongs_to_many :agents, join_table: :comee_core_clients_agents has_many :client_warehouses has_many :client_addresses validates :code, :name, :match_code, :locale, presence: true validates :code, uniqueness: true delegate(:name, to: :user, prefix: true, allow_nil: true) def self.ransackable_attributes(_auth_object = nil) %w[ id user_id address code name match_code locale parent_id subsidiary ] end def self.ransackable_associations(_auth_object = nil) ["parent"] end end end end
Version data entries
57 entries across 57 versions & 1 rubygems