diff --git a/CHANGELOG.md b/CHANGELOG.md index 35ed4a0db..c85c52004 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ User-visible changes worth mentioning. - [#1622] Drop support for Rubies 2.5 and 2.6 - [#1605] Fix URI validation for Ruby 3.2+. - [#1625] Exclude endless access tokens from `StaleRecordsCleaner`. +- [#1626] Remove deprecated `active_record_options` config option. ## 5.6.2 diff --git a/lib/doorkeeper/config.rb b/lib/doorkeeper/config.rb index 18991a9bc..180863d48 100644 --- a/lib/doorkeeper/config.rb +++ b/lib/doorkeeper/config.rb @@ -324,11 +324,6 @@ def configure_secrets_for(type, using:, fallback:) option :skip_client_authentication_for_password_grant, default: false - # TODO: remove the option - option :active_record_options, - default: {}, - deprecated: { message: "Customize Doorkeeper models instead" } - # Hook to allow arbitrary user-client authorization option :authorize_resource_owner_for_client, default: ->(_client, _resource_owner) { true } diff --git a/lib/doorkeeper/orm/active_record.rb b/lib/doorkeeper/orm/active_record.rb index eacef3b65..deef164c3 100644 --- a/lib/doorkeeper/orm/active_record.rb +++ b/lib/doorkeeper/orm/active_record.rb @@ -29,20 +29,7 @@ module Mixins end def self.run_hooks - # Deprecated, will be removed soon - return unless (options = Doorkeeper.config.active_record_options[:establish_connection]) - - Doorkeeper::Orm::ActiveRecord.models.each do |model| - model.establish_connection(options) - end - end - - def self.models - [ - Doorkeeper.config.access_grant_model, - Doorkeeper.config.access_token_model, - Doorkeeper.config.application_model, - ] + # nop end end end diff --git a/spec/lib/config_spec.rb b/spec/lib/config_spec.rb index 48d6b3ff7..6b5e6d8f1 100644 --- a/spec/lib/config_spec.rb +++ b/spec/lib/config_spec.rb @@ -626,33 +626,6 @@ if DOORKEEPER_ORM == :active_record class FakeCustomModel; end - describe "active_record_options" do - let(:models) { [Doorkeeper::AccessGrant, Doorkeeper::AccessToken, Doorkeeper::Application] } - - before do - models.each do |model| - allow(model).to receive(:establish_connection).and_return(true) - end - end - - it "establishes connection for Doorkeeper models based on options" do - expect(models).to all(receive(:establish_connection)) - - expect(Kernel).to receive(:warn).with( - /\[DOORKEEPER\] active_record_options has been deprecated and will soon be removed/, - ) - - Doorkeeper.configure do - orm DOORKEEPER_ORM - active_record_options( - establish_connection: Rails.configuration.database_configuration[Rails.env], - ) - end - - Doorkeeper.setup - end - end - describe "access_token_class" do it "uses default doorkeeper value" do expect(config.access_token_class).to eq("Doorkeeper::AccessToken")