Ruby was passing a db query instead of a string name