aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/join_model_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-10-12 13:25:21 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-10-12 13:25:21 -0700
commit84c37741e005b3ac6807be1caf5255c041f12693 (patch)
treede50bcacd34633b7cf275544c83cf24ea4b1149c /activerecord/test/cases/associations/join_model_test.rb
parenteefb34438563b6b58e65b2ac0e06c543f76e2247 (diff)
parent990a938cf7527b654cef06674f25f3632920bad7 (diff)
downloadrails-84c37741e005b3ac6807be1caf5255c041f12693.tar.gz
rails-84c37741e005b3ac6807be1caf5255c041f12693.tar.bz2
rails-84c37741e005b3ac6807be1caf5255c041f12693.zip
Merge pull request #7925 from ernie/3-2-fix-collection-associations-with-select
Fix has_many assocation w/select load after create
Diffstat (limited to 'activerecord/test/cases/associations/join_model_test.rb')
-rw-r--r--activerecord/test/cases/associations/join_model_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb
index f4592f7d0e..8bd44e6444 100644
--- a/activerecord/test/cases/associations/join_model_test.rb
+++ b/activerecord/test/cases/associations/join_model_test.rb
@@ -236,6 +236,14 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
assert_equal "2", categories(:sti_test).authors_with_select.first.post_id.to_s
end
+ def test_create_through_has_many_with_piggyback
+ category = categories(:sti_test)
+ ernie = category.authors_with_select.create(:name => 'Ernie')
+ assert_not_deprecated do
+ assert_equal ernie, category.authors_with_select.detect {|a| a.name == 'Ernie'}
+ end
+ end
+
def test_include_has_many_through
posts = Post.find(:all, :order => 'posts.id')
posts_with_authors = Post.find(:all, :include => :authors, :order => 'posts.id')