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?