From 7584fe53db1328e89e86fb91ce04d4410fc05002 Mon Sep 17 00:00:00 2001 From: Jordan Owens Date: Fri, 17 Nov 2023 22:54:26 -0500 Subject: [PATCH 1/3] Bump version to 1.5.1 --- lib/activerecord-import/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/activerecord-import/version.rb b/lib/activerecord-import/version.rb index 4542de2d..425ab636 100644 --- a/lib/activerecord-import/version.rb +++ b/lib/activerecord-import/version.rb @@ -2,6 +2,6 @@ module ActiveRecord module Import - VERSION = "1.5.0" + VERSION = "1.5.1" end end From e9cac1a02a866cd25539a9bc3e81137d6d96840b Mon Sep 17 00:00:00 2001 From: Jordan Owens Date: Fri, 17 Nov 2023 22:59:10 -0500 Subject: [PATCH 2/3] Update changelog for 1.5.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f691771..18bef994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Changes in 1.5.1 + +### Fixes + +* Stop memoizing schema_columns_hash so dynamic schema changes are picked up. Thanks to @koshigoe via \##812. + ## Changes in 1.5.0 ### New Features From 3e12169f741f13f58073a076e7bbedc9b01637c9 Mon Sep 17 00:00:00 2001 From: Jordan Owens Date: Fri, 17 Nov 2023 23:27:28 -0500 Subject: [PATCH 3/3] Fix failing specs --- test/models/book.rb | 2 +- test/models/customer.rb | 10 ++++++---- test/models/order.rb | 10 ++++++---- test/models/tag_alias.rb | 4 +++- 4 files changed, 16 insertions(+), 10 deletions(-) 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 diff --git a/test/models/tag_alias.rb b/test/models/tag_alias.rb index bae96faa..2beeb21a 100644 --- a/test/models/tag_alias.rb +++ b/test/models/tag_alias.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true class TagAlias < ActiveRecord::Base - belongs_to :tag, foreign_key: [:tag_id, :parent_id], required: true + unless ENV["SKIP_COMPOSITE_PK"] + belongs_to :tag, foreign_key: [:tag_id, :parent_id], required: true + end end