ruby on rails - How do I find all the records regardless of case -
what can find case insensitive search
>> band.find_by_name("metallica") => nil >> band.find_by_name("metallica") => #<band id: 3, name: "metallica", created_at: "2010-10-03 01:17:24", updated_at: "2010-10-03 01:17:24", user_id: "4">
i need find record in both cases...any suggestions?
band.find(:all, :conditions => ['name = lower(?)', band_name.downcase])
Comments
Post a Comment