Sha256: 069ddbd59f9f84934bb5f140c3bf38e5e7d34c5b9d52436f55db811afafe3d58
Contents?: true
Size: 1.02 KB
Versions: 5
Compression:
Stored size: 1.02 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 validates :code, :name, :match_code, :address, :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 locale parent_id subsidiary ] end def self.ransackable_associations(_auth_object = nil) ["parent"] end end end end
Version data entries
5 entries across 5 versions & 1 rubygems