Displaying 1 result from an estimated 1 matches for "opts1".
Did you mean:
opts
2006 Jul 23
0
[PATCH] (+tests) with_scope :order doesn''t work with included associations
...own?)
with_scope doesn''t support :order in the presence of :include. For
example:
{{{
# We''re testing the interaction between :order, :include, and
with_scope.
TEST_ORDER = ''tickets.created_at DESC''
TEST_INCLUDE = [''owner'']
def test_find(opts1, opts2)
Ticket.with_scope(:find => opts1) do
Ticket.find(:all, opts2).map {|t| t.id }
end
end
# In these examples, :order is respected.
test_find({ :order => TEST_ORDER }, {})
test_find({}, { :include => TEST_INCLUDE, :order => TEST_ORDER })
test_find({ :include => TEST_I...