aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_associations_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2013-01-18 12:30:47 +0000
committerJon Leighton <j@jonathanleighton.com>2013-01-18 12:30:47 +0000
commit5937bd02dee112646469848d7fe8a8bfcef5b4c1 (patch)
tree9406b572ea9d9fadcfabca94084834e1188f8c25 /activerecord/test/cases/associations/has_many_associations_test.rb
parent5f759ff063b8ed054cdde0ed4f3593ef89fe59b7 (diff)
downloadrails-5937bd02dee112646469848d7fe8a8bfcef5b4c1.tar.gz
rails-5937bd02dee112646469848d7fe8a8bfcef5b4c1.tar.bz2
rails-5937bd02dee112646469848d7fe8a8bfcef5b4c1.zip
Undeprecate the :extend option
Suggested by @dhh. It doesn't affect the generated SQL, so seems reasonable to continue to allow it as an association option.
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index 2aa3ecb108..d42630e1b7 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -1717,4 +1717,16 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
author = authors(:mary)
assert !author.first_posts.exists?
end
+
+ test "association with extend option" do
+ post = posts(:welcome)
+ assert_equal "lifo", post.comments_with_extend.author
+ assert_equal "hello", post.comments_with_extend.greeting
+ end
+
+ test "association with extend option with multiple extensions" do
+ post = posts(:welcome)
+ assert_equal "lifo", post.comments_with_extend_2.author
+ assert_equal "hello", post.comments_with_extend_2.greeting
+ end
end