You can define your own scope.

          named_scope :name_contains, lambda { |str|
            { :conditions => ["table_name.name ILIKE ?", "%#{str}%"] }
          }

To get case insensitive with postgres it's ILIKE instead of like.  Depending 
on whether you need to worry about multiple db support you might want to 
make that conditional so it doesn't break if someone if used with another 
db.  Warning, above code is untested and based on the hobo automatic scope 
to boot.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/hobousers/-/JcF825glRgAJ.
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/hobousers?hl=en.

Reply via email to