Impressed Again
Posted 2006 Dec 12I’ve been working on a big Rails project and I’m still finding things that impress me. Recently, I wanted the equivalent of SQL’s “IN” statement, e.g.
select *
from people
where first_name in ('MrChucho','MsChucho')
I wasn’t immediately sure how to do this with Active Record, so I tried what seemed most intuitive: passing an Array to find…
Person.find_by_first_name(['MrChucho','MsChucho'])
It worked perfectly!
cat claws
2008 Aug 08 at 19:30don’t quite get it…but lets see… mr. know it all…