diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-07-01 22:44:24 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-07-01 22:44:24 +0200 |
commit | a444ea3478586befdc24b8152e15dc13884a3697 (patch) | |
tree | 14fef6e2dfa415e20955f1b53d44fa466129cca0 /activerecord | |
parent | 53394420287009ac18ddb2831c981ea93e9491d0 (diff) | |
download | rails-a444ea3478586befdc24b8152e15dc13884a3697.tar.gz rails-a444ea3478586befdc24b8152e15dc13884a3697.tar.bz2 rails-a444ea3478586befdc24b8152e15dc13884a3697.zip |
remove deprecated `ActiveRecord::Base#connection` method.
Diffstat (limited to 'activerecord')
-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 |