Sha256: 3d353cfcdf03672b857fe472d00669dd568aa19cb9a1fddd1ca16a6a4375ff40

Contents?: true

Size: 580 Bytes

Versions: 11

Compression:

Stored size: 580 Bytes

Contents

module Comee
  module Core
    class Supplier < ApplicationRecord
      belongs_to :user, optional: true
      belongs_to :currency, optional: true
      has_and_belongs_to_many :contacts, join_table: :comee_core_suppliers_contacts

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

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

      def self.ransackable_associations(_auth_object = nil)
        %w[user]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
comee_core-0.2.87 app/models/comee/core/supplier.rb
comee_core-0.2.86 app/models/comee/core/supplier.rb
comee_core-0.2.85 app/models/comee/core/supplier.rb
comee_core-0.2.84 app/models/comee/core/supplier.rb
comee_core-0.2.83 app/models/comee/core/supplier.rb
comee_core-0.2.82 app/models/comee/core/supplier.rb
comee_core-0.2.81 app/models/comee/core/supplier.rb
comee_core-0.2.80 app/models/comee/core/supplier.rb
comee_core-0.2.78 app/models/comee/core/supplier.rb
comee_core-0.2.77 app/models/comee/core/supplier.rb
comee_core-0.2.76 app/models/comee/core/supplier.rb