spec/extensions/eager_each_spec.rb in sequel-4.8.0 vs spec/extensions/eager_each_spec.rb in sequel-4.9.0
- old
+ new
@@ -31,6 +31,12 @@
ds.each{|c| a << c}
a.should == [@c.load(:id=>1, :parent_id=>nil), @c.load(:id=>2, :parent_id=>nil)]
a.map{|c| c.associations[:children]}.should == [[@c.load(:id=>3, :parent_id=>1), @c.load(:id=>4, :parent_id=>1)], [@c.load(:id=>5, :parent_id=>2), @c.load(:id=>6, :parent_id=>2)]]
@c.db.sqls.should == ['SELECT items.id, items.parent_id, children.id AS children_id, children.parent_id AS children_parent_id FROM items LEFT OUTER JOIN items AS children ON (children.parent_id = items.id)']
end
+
+ it "should not attempt to eager load when getting the columns" do
+ ds = @c.eager(:children)
+ def ds.all; raise; end
+ proc{ds.columns!}.should_not raise_error
+ end
end