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
For DB for NULL the syntax should be
my_id IS NULL
So you can give it as:
MyTable.where("my_id is NULL ").first