aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-07-27 12:36:00 +0100
committerJon Leighton <j@jonathanleighton.com>2011-07-27 12:36:00 +0100
commit24f0a872e660647fe1abf187748660a77da3fe0a (patch)
tree90d73dab29167e425d260f4f9335f103aec35482 /activerecord/test
parent46b8261830d25d444a95e496e5f8becc27df76cc (diff)
downloadrails-24f0a872e660647fe1abf187748660a77da3fe0a.tar.gz
rails-24f0a872e660647fe1abf187748660a77da3fe0a.tar.bz2
rails-24f0a872e660647fe1abf187748660a77da3fe0a.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')
-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