Given these 2 scoped queries it does not seem possible to use
Foo.active.latest
def self.active
(all(:ends_at.gt => Time.now) | all(:ends_at => nil)) &
all(:finished_at => nil)
end
def self.latest
all(:order => [:created_at.desc])
end
It will always return items that are not active. If I reverse the
scopes though and use Foo.latest.active it does indeed return the
expected results.
Is the order important?
--
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en.