I found out that using where with symbol :my_id => nil and using old school one with ? is different. Could anyone explain me why?
MyTable.where(\"my_id = ? \", n
In rails 4 you can specify the value as null using the new hash syntax.
MyTable.where(my_id: nil).first