Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
validate_uniqueness_of (2.3.5) with scoping broken against PostgreSQL 9.0 #901
Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6527
validate_uniqueness_of does not quote scoped values when constructing the SQL query, so if the scoped column happens to be text, you get a PGError. (PostgreSQL 8.2 server did not complain)
Here is the specific error from the database:
I have written a patch against ActiveRecord::Validations (see attached). I would gladly write tests too, but I'm running on Gentoo, which does not know about libxml2-dev or libxslt1-dev, and "gem install bundler" is timing out right now, too. So I don't have a formal test setup (but my patch works in the above case).