aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_one_associations_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-05-11 08:11:17 +0100
committerJon Leighton <j@jonathanleighton.com>2011-05-11 08:56:01 +0100
commitaa1fc1c88cb58b6387cb7a8560aac78ef56fa024 (patch)
tree61c080c9ca73b2a8d8ecf505cb8600f0b851f43b /activerecord/test/cases/associations/has_one_associations_test.rb
parent6d51f9b98c39e13422ba321d2d5e18734895ebb2 (diff)
downloadrails-aa1fc1c88cb58b6387cb7a8560aac78ef56fa024.tar.gz
rails-aa1fc1c88cb58b6387cb7a8560aac78ef56fa024.tar.bz2
rails-aa1fc1c88cb58b6387cb7a8560aac78ef56fa024.zip
Bring back obj.association_loaded? as a deprecated method. Fixes #472.
Diffstat (limited to 'activerecord/test/cases/associations/has_one_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/has_one_associations_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_one_associations_test.rb b/activerecord/test/cases/associations/has_one_associations_test.rb
index f3c96ccbe6..625515f4f1 100644
--- a/activerecord/test/cases/associations/has_one_associations_test.rb
+++ b/activerecord/test/cases/associations/has_one_associations_test.rb
@@ -359,4 +359,13 @@ class HasOneAssociationsTest < ActiveRecord::TestCase
assert_equal pirate.id, ships(:black_pearl).reload.pirate_id
assert_nil new_ship.pirate_id
end
+
+ def test_deprecated_association_loaded
+ firm = companies(:first_firm)
+ firm.association(:account).stubs(:loaded?).returns(stub)
+
+ assert_deprecated do
+ assert_equal firm.association(:account).loaded?, firm.account_loaded?
+ end
+ end
end