Some methods have been deprecated with Rails3. It is the case in particular with the following call !
Error.find(:all, :select => 'DISTINCT type')
Is anybody have an idea, how to convert this call to an ActiveRecord3 valid statement ?
I found nothing on the web ...
Thanks
Just use the new select
query method.
Error.select('DISTINCT type')
If you seek to get a distinct set of returns against a PostGreSQL database, you must use:
Error.select('DISTINCT ON(type)')
and if your in the context of a scope, perhaps something like the following to ensure that you get all the fields:
scope :running, select('DISTINCT ON(campaigns.budget) campaigns.*')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With