diff --git a/Rakefile b/Rakefile index aca38df5..b4c66d5e 100644 --- a/Rakefile +++ b/Rakefile @@ -135,7 +135,7 @@ end def migrate # TODO: Figure out if there is any other possibility that can/should be # passed here as the second argument for the migration context - if ActiveRecord.version > "7.1" + if ActiveRecord.version > '7.1' ActiveRecord::MigrationContext.new('spec/dummy/db/migrate').migrate else ActiveRecord::MigrationContext.new('spec/dummy/db/migrate', ActiveRecord::SchemaMigration).migrate diff --git a/lib/apartment.rb b/lib/apartment.rb index 0bf253f1..e35fda4a 100644 --- a/lib/apartment.rb +++ b/lib/apartment.rb @@ -5,6 +5,7 @@ require 'forwardable' require 'active_record' require 'apartment/tenant' +require 'apartment/deprecation' require_relative 'apartment/log_subscriber' require_relative 'apartment/active_record/connection_handling' @@ -47,7 +48,7 @@ def tenants_with_config end def tld_length=(_) - Apartment::Deprecation.warn('`config.tld_length` have no effect because it was removed in https://github.com/influitive/apartment/pull/309') + Apartment::DEPRECATOR.warn('`config.tld_length` have no effect because it was removed in https://github.com/influitive/apartment/pull/309') end def db_config_for(tenant) diff --git a/lib/apartment/deprecation.rb b/lib/apartment/deprecation.rb index db73dd5d..d12864a5 100644 --- a/lib/apartment/deprecation.rb +++ b/lib/apartment/deprecation.rb @@ -3,9 +3,5 @@ require 'active_support/deprecation' module Apartment - module Deprecation - def self.warn(message) - ActiveSupport::Deprecation.warn message - end - end + DEPRECATOR = ActiveSupport::Deprecation.new(Apartment::VERSION, 'Apartment') end diff --git a/ros-apartment.gemspec b/ros-apartment.gemspec index 1cf73614..f413e49e 100644 --- a/ros-apartment.gemspec +++ b/ros-apartment.gemspec @@ -33,6 +33,7 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 3.1', '<= 3.4' s.add_dependency 'activerecord', '>= 6.1.0', '<= 8.1' + s.add_dependency 'activesupport', '>= 6.1.0' s.add_dependency 'parallel', '< 2.0' s.add_dependency 'public_suffix', '>= 2.0.5', '<= 6.0.1' s.add_dependency 'rack', '>= 1.3.6', '< 4.0'