Sha256: c6ee952162d6ca2856478b5cb52fbb5761a59e78d4e8eb7336aad87b62fb9a14

Contents?: true

Size: 500 Bytes

Versions: 2

Compression:

Stored size: 500 Bytes

Contents

# frozen_string_literal: true

class Customer < ActiveRecord::Base
  unless ENV["SKIP_COMPOSITE_PK"]
    if ENV['AR_VERSION'].to_f <= 7.0
      has_many :orders,
               inverse_of: :customer,
               primary_key: %i(account_id id),
               foreign_key: %i(account_id customer_id)
    else
      has_many :orders,
               inverse_of: :customer,
               primary_key: %i(account_id id),
               query_constraints: %i(account_id customer_id)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-import-1.8.1 test/models/customer.rb
activerecord-import-1.8.0 test/models/customer.rb