Fix error with == in activerecord where clause