aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/lib
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-11-11 10:02:14 -0500
committerJosé Valim <jose.valim@gmail.com>2010-11-11 17:14:47 +0100
commitfbaf3a23d909bca79bae3ebb77249483fcab5383 (patch)
treefd7085ecacd793c1fdd2d452a0a19f6ba0f0caf7 /actionpack/test/lib
parenta8974028634a1ff5ecce46c1a79d305f58ba4338 (diff)
downloadrails-fbaf3a23d909bca79bae3ebb77249483fcab5383.tar.gz
rails-fbaf3a23d909bca79bae3ebb77249483fcab5383.tar.bz2
rails-fbaf3a23d909bca79bae3ebb77249483fcab5383.zip
fields_for should treat ActiveRecord::Relation as an array
[#5795 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/lib')
-rw-r--r--actionpack/test/lib/controller/fake_models.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/lib/controller/fake_models.rb b/actionpack/test/lib/controller/fake_models.rb
index dba632e6df..ae0c38184d 100644
--- a/actionpack/test/lib/controller/fake_models.rb
+++ b/actionpack/test/lib/controller/fake_models.rb
@@ -184,3 +184,13 @@ module Blog
end
end
end
+
+class ArelLike
+ def to_ary
+ true
+ end
+ def each
+ a = Array.new(2) { |id| Comment.new(id + 1) }
+ a.each { |i| yield i }
+ end
+end