From 51c6bf13e66f5c9a44def414e6490b7f7e339ffd Mon Sep 17 00:00:00 2001 From: Joseph Southan Date: Wed, 21 Aug 2024 12:08:06 +0100 Subject: [PATCH] Fixup ActiveRecord check and update changelog --- CHANGELOG.md | 3 ++- lib/active_record/safer_migrations/postgresql_adapter.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17397ff..de662c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # 4.0.0 / 2024-08-21 -- Remove support for Ruby =< 3.0 and Rails =< 6.0 +- Remove support for Ruby =< 3.0 and Rails < 7.0 +- Add support for ActiveRecord 7.2 (#98) # 3.0.0 / 2020-09-28 diff --git a/lib/active_record/safer_migrations/postgresql_adapter.rb b/lib/active_record/safer_migrations/postgresql_adapter.rb index f03f3f8..06de162 100644 --- a/lib/active_record/safer_migrations/postgresql_adapter.rb +++ b/lib/active_record/safer_migrations/postgresql_adapter.rb @@ -33,7 +33,7 @@ def get_setting(setting_name) end def fill_sql_values(sql, values) - if Rails.version >= '7.2.0' + if ActiveRecord.version >= '7.2.0' ActiveRecord::Base.send(:replace_named_bind_variables, self, sql, values) else ActiveRecord::Base.send(:replace_named_bind_variables, sql, values)