Sha256: a4b2ed24b303b9d5090dec99b7d2daa36ea772079a96ebfee2c0544737c8c7da

Contents?: true

Size: 533 Bytes

Versions: 1

Compression:

Stored size: 533 Bytes

Contents

# frozen_string_literal: true

class Customer < ActiveRecord::Base
  unless ENV["SKIP_COMPOSITE_PK"]
    if ENV['AR_VERSION'].to_f <= 7.0 || ENV['AR_VERSION'].to_f >= 8.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

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-import-2.0.0 test/models/customer.rb