aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-05-19 23:28:44 +0100
committerJon Leighton <j@jonathanleighton.com>2011-05-19 23:28:44 +0100
commit0afd5850f5bba4bd3f1218e27a4a1488c9fdb83e (patch)
treea5444cdbf2b70d9883ef66a751461b386738eedd /activerecord/test
parentc0374999c8656e02db38ab8198af76a411669a53 (diff)
downloadrails-0afd5850f5bba4bd3f1218e27a4a1488c9fdb83e.tar.gz
rails-0afd5850f5bba4bd3f1218e27a4a1488c9fdb83e.tar.bz2
rails-0afd5850f5bba4bd3f1218e27a4a1488c9fdb83e.zip
Implement proxy_owner, proxy_target and proxy_reflection methods on CollectionProxy with deprecations. Fixes #1148.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb
index 49d82ba2df..38d439d68a 100644
--- a/activerecord/test/cases/associations_test.rb
+++ b/activerecord/test/cases/associations_test.rb
@@ -203,6 +203,18 @@ class AssociationProxyTest < ActiveRecord::TestCase
assert_equal david.projects, david.projects.reload.reload
end
end
+
+ # Tests that proxy_owner, proxy_target and proxy_reflection are implement as deprecated methods
+ def test_proxy_deprecations
+ david = developers(:david)
+ david.projects.load_target
+
+ [:owner, :target, :reflection].each do |name|
+ assert_deprecated do
+ assert_equal david.association(:projects).send(name), david.projects.send("proxy_#{name}")
+ end
+ end
+ end
end
class OverridingAssociationsTest < ActiveRecord::TestCase