How to do a Rails search in multiple columns

How do I find a search term in Rails that might be in several columns?

  named_scope :with_name_or_keyword, lambda { |*args| {:conditions => ["speakers.name like ? OR speakers.bio like ? OR speakers.tagline like ?", ("%#{args.first}%" || ""), ("%#{args.first}%" || ""), ("%#{args.first}%" || "")]} }

will work with something like this:

Speaker.with_name_or_keyword("Dave")

Anti-Spam Protection by WP-SpamFree

line
footer
Powered by Wordpress | Designed by Elegant Themes