Sha256: 4c881a772ad3822aa47366d5e36131488d5f9b4794864b1cfbb42782fd8e8bd0

Contents?: true

Size: 503 Bytes

Versions: 24

Compression:

Stored size: 503 Bytes

Contents

module Comee
  module Core
    class Client < ApplicationRecord
      belongs_to :user, optional: true
      has_many :warehouse_shipments

      validates :code, :name, :address, :locale, presence: true
      validates :code, uniqueness: true

      delegate(:name, to: :user, prefix: true)

      def self.ransackable_attributes(_auth_object = nil)
        %w[
          user_id
          address
          code
          name
          discount
          locale
        ]
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
comee_core-0.1.45 app/models/comee/core/client.rb
comee_core-0.1.45.pre3 app/models/comee/core/client.rb
comee_core-0.1.45.pre2 app/models/comee/core/client.rb
comee_core-0.1.45.pre app/models/comee/core/client.rb