diff --git a/test/models/book.rb b/test/models/book.rb index 02c10a86..7beee340 100644 --- a/test/models/book.rb +++ b/test/models/book.rb @@ -2,7 +2,7 @@ class Book < ActiveRecord::Base belongs_to :topic, inverse_of: :books - belongs_to :tag, foreign_key: [:tag_id, :parent_id] + belongs_to :tag, foreign_key: [:tag_id, :parent_id] unless ENV["SKIP_COMPOSITE_PK"] has_many :chapters, inverse_of: :book has_many :discounts, as: :discountable diff --git a/test/models/customer.rb b/test/models/customer.rb index d2b81930..9686bd83 100644 --- a/test/models/customer.rb +++ b/test/models/customer.rb @@ -1,8 +1,10 @@ # frozen_string_literal: true class Customer < ActiveRecord::Base - has_many :orders, - inverse_of: :customer, - primary_key: %i(account_id id), - foreign_key: %i(account_id customer_id) + unless ENV["SKIP_COMPOSITE_PK"] + has_many :orders, + inverse_of: :customer, + primary_key: %i(account_id id), + foreign_key: %i(account_id customer_id) + end end diff --git a/test/models/order.rb b/test/models/order.rb index 36eb579c..45a67fcf 100644 --- a/test/models/order.rb +++ b/test/models/order.rb @@ -1,8 +1,10 @@ # frozen_string_literal: true class Order < ActiveRecord::Base - belongs_to :customer, - inverse_of: :orders, - primary_key: %i(account_id id), - foreign_key: %i(account_id customer_id) + unless ENV["SKIP_COMPOSITE_PK"] + belongs_to :customer, + inverse_of: :orders, + primary_key: %i(account_id id), + foreign_key: %i(account_id customer_id) + end end