From aa1fc1c88cb58b6387cb7a8560aac78ef56fa024 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Wed, 11 May 2011 08:11:17 +0100 Subject: Bring back obj.association_loaded? as a deprecated method. Fixes #472. --- .../test/cases/associations/has_one_associations_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'activerecord/test/cases/associations/has_one_associations_test.rb') 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 -- cgit v1.2.3