diff options
-rw-r--r-- | activerecord/CHANGELOG.md | 5 | ||||
-rw-r--r-- | activerecord/lib/active_record/core.rb | 8 | ||||
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 4 |
3 files changed, 5 insertions, 12 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index f8ef03aebb..6154c0b198 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,8 @@ +* Remove deprecated `ActiveRecord::Base#connection` method. + Make sure to access it via the class. + + *Yves Senn* + * Remove deprecation warning for `auto_explain_threshold_in_seconds`. *Yves Senn* diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index ad2f9430a3..f306243552 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -337,14 +337,6 @@ module ActiveRecord @readonly = true end - # Returns the connection currently associated with the class. This can - # also be used to "borrow" the connection to do database work that isn't - # easily done without going straight to SQL. - def connection - ActiveSupport::Deprecation.warn("#connection is deprecated in favour of accessing it via the class") - self.class.connection - end - def connection_handler self.class.connection_handler end diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index df6edc4057..2aa56ebc55 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -493,10 +493,6 @@ class CustomConnectionFixturesTest < ActiveRecord::TestCase fixtures :courses self.use_transactional_fixtures = false - def test_connection_instance_method_deprecation - assert_deprecated { courses(:ruby).connection } - end - def test_leaky_destroy assert_nothing_raised { courses(:ruby) } courses(:ruby).destroy |