From fbaf3a23d909bca79bae3ebb77249483fcab5383 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Thu, 11 Nov 2010 10:02:14 -0500 Subject: fields_for should treat ActiveRecord::Relation as an array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [#5795 state:resolved] Signed-off-by: José Valim --- actionpack/test/lib/controller/fake_models.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test/lib/controller') 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 -- cgit v1.2.3