This project is archived and is in readonly mode.
validates_uniqueness_of doesn't escape attributes
-
Rick
It's not actually quoting the column name though, is it? It looks like it's only disambiguating the column name by adding the table name to it.
-
Alex MacCaw
That's right. I thought about escaping the column name, however I decided I'd follow the convention which seems to escape the table name, rather than the column name (and provides a ready method to do so).
-
Frederick Cheung
Surely you only need to escape the column name though (and could not escaping the column break things if it was called something like "foo from"?)
-
Alex MacCaw
I didn't know you could have spaces in column names - but if this is a problem then by all means just escape the column name.
-
Michael Koziarski
Yeah, this looks good to go if you could switch it to use quote_column_name instead of the table name, and upload the two patches into a single patch file. For instructions on using git-format-patch see http://www.tpope.net/rails-git-b...
Nice find, and nice work.
-
DHH
- State changed from new to incomplete
Change status to open when koz's suggestions are implemented.
-
Alex MacCaw
I don't think uploading a file to a ticket makes it go back into the feed. I've added the changes koz suggested and re-uploaded the patch (in Git's format).
-
Michael Koziarski
- State changed from incomplete to open
-
Repository
- State changed from open to resolved
(from [4cc594bd708df1ec67b61833493198ab0009c627]) Fix validates_uniqueness_of for SQL keywords [#23 state:resolved]
Signed-off-by: Pratik Naik
