diff options
author | Xavier Noria <fxn@hashref.com> | 2010-03-12 22:19:10 +0100 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-03-12 13:22:47 -0800 |
commit | 89eae2d18711023d5c27f5375add219511523f0a (patch) | |
tree | d55d7317a2d1f809586470428d82e6c718848b77 | |
parent | 94a60a5600269a9ce63eb8991c4deaa26cd0a7b6 (diff) | |
download | rails-89eae2d18711023d5c27f5375add219511523f0a.tar.gz rails-89eae2d18711023d5c27f5375add219511523f0a.tar.bz2 rails-89eae2d18711023d5c27f5375add219511523f0a.zip |
adds coverage for the issue addressed in fe43bbd
[#4166 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
-rw-r--r-- | activerecord/test/cases/associations_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb index 9bc34bd750..d0d646d460 100644 --- a/activerecord/test/cases/associations_test.rb +++ b/activerecord/test/cases/associations_test.rb @@ -180,6 +180,20 @@ class AssociationProxyTest < ActiveRecord::TestCase end end + def test_splat_does_not_invoke_to_a_on_singular_targets + Kernel.module_eval do + alias original_to_a to_a + def to_a + [:_] + end + end + assert_not_equal [:_], [*posts(:welcome).author] + ensure + Kernel.module_eval do + alias to_a original_to_a + end + end + def setup_dangling_association josh = Author.create(:name => "Josh") p = Post.create(:title => "New on Edge", :body => "More cool stuff!", :author => josh) |