Mismatched Key Data Types in Rails and Postgresql

I switched my database over from sqlite3 to postgresql for an application I’m developing for my MS research, and suddenly received this error when I tried to run my application:

Moperator does not exist: integer = character varying

After a little searching and poking, I found out that I had accidentally set up one of my foreign keys as a string data type, and was having it compared to an integer data type of the primary key of a different table.

sqlite3 didn’t catch the error, and worked around it, but postgresql seems to be more fussy. Helped me catch a mistake though.