hayafirst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jun-26 13:35 UTC
validates_uniqueness_of and MySQL enum type
I tried to check validates_uniqueness_of for a MySql enum type column with a scope given, like this: validates_uniqueness_of :phone_type, :scope => :user_id And It didn''t work. When I check the SQL statement for doing this validation, it is like this: SELECT `phone_numbers`.id FROM `phone_numbers` WHERE (`phone_numbers`.`phone_type` = BINARY '''' AND `phone_numbers`.user_id = 23) LIMIT 1 phone_type was set to be "Home". If I try validates_uniqueness_of on any other columns. it works fine. Could some please highlight me what''s going on? Thanks