I'm trying to write a Rails 2.1 query (I know that I should upgrade, but that's not my decision at the moment) which using the 'IN' condition. It doesn't seem to work as expected.
It only takes into consideration the roles_id = 21 based on the below query and it doesn't consider both the roles_id(i.e., 21 and 31) to display the correct count.
Admin.find(:all, :conditions => ["test_column1 = ? and roles_id IN (?) and test_column2 = ?",234, '21,31', 1]).count How can I get this right?