For some reason tbl.where return nil. Maybe it is something todo with the stupid dot notations or inherently a bug with how where works.