aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-07-27 12:36:00 +0100
committerXavier Noria <fxn@hashref.com>2011-08-13 16:22:20 -0700
commit05f1a9bcc3c9223768187e2379b508638dfa19b6 (patch)
treeeba4563b6fafd6ece21d1ed4eb55ab3ef3bc6a4b /activerecord/test/cases/associations_test.rb
parent924975a34aa3337cdf7a68f76bcae205815778f1 (diff)
downloadrails-05f1a9bcc3c9223768187e2379b508638dfa19b6.tar.gz
rails-05f1a9bcc3c9223768187e2379b508638dfa19b6.tar.bz2
rails-05f1a9bcc3c9223768187e2379b508638dfa19b6.zip
Add a proxy_association method to association proxies, which can be called by association extensions to access information about the association. This replaces proxy_owner etc with proxy_association.owner.
Diffstat (limited to 'activerecord/test/cases/associations_test.rb')
-rw-r--r--activerecord/test/cases/associations_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb
index 49d82ba2df..ffe2993e0f 100644
--- a/activerecord/test/cases/associations_test.rb
+++ b/activerecord/test/cases/associations_test.rb
@@ -203,6 +203,11 @@ class AssociationProxyTest < ActiveRecord::TestCase
assert_equal david.projects, david.projects.reload.reload
end
end
+
+ def test_proxy_association_accessor
+ david = developers(:david)
+ assert_equal david.association(:projects), david.projects.proxy_association
+ end
end
class OverridingAssociationsTest < ActiveRecord::TestCase