Sha256: 2768247aaf87240e40f73da488a8c3c573be7029f80a1301e62f5bedbe4f878f
Contents?: true
Size: 1.04 KB
Versions: 11
Compression:
Stored size: 1.04 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 match_code locale parent_id subsidiary ] end def self.ransackable_associations(_auth_object = nil) ["parent"] end end end end
Version data entries
11 entries across 11 versions & 1 rubygems