Hi,
I've got a plugin I'm using for websites using Rails 2.X or Rails 3.
In Rails 2.3, I used a lot the 'scoped' method for complex queries :
p = Person.scoped({})
p = p.active
p = p.with_premium_plan if xyz
p
etc.
But I saw that it changed in Rails 3 :
p = Person.scoped
etc.
So is it normal that I have to do something like that in my plugin (to be able to run it in both version of Rails), or can you suggest something nicer?
if Rails.version.split(".")[0] == "3"
p = Person.scoped
else
p = Person.scoped({})
end
Thanks! Vince