Tag Archives: Active Record

ActiveRecord find and MySql ‘IN’ gotcha

In my latest project I needed to fetch a group of tasks who where linked to a  group of categories. All that I have are the Id’s of te categories which made me write the following code Tasks.find(:all, :conditions => ["categorie_id IN (?)", @categories.join(',')]) It seemed to work, but apparently I didn’t test [...]
Posted in Coding, Ruby on Rails | Also tagged , | 2 Comments
  •  

    March 2010
    M T W T F S S
    « Jul    
    1234567
    891011121314
    15161718192021
    22232425262728
    293031