I love new Rail 3!
The new query syntax is so awesome:
users = User.where(:name => 'Bob', :last_name => 'Brown')
But when we need to do something like
SELECT * FROM Users WHERE Age >= const AND Money > const2
We have to use
users = User.where('Age >= ? and money > ?', const, const2)
Which is not very cool. The following query is not safe because of SQL injection:
users = User.where('Age >= #{const} and money > #{const2}')
I like the C#/LINQ version
var users = DB.Where(u => u.Age >= const && u.Money > const2);
Is there a way to do something like that in Rails?