diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-18 09:08:11 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-12-18 09:08:11 -0200 |
commit | f6d0eda918756bf56e2c05afcaaabda723487017 (patch) | |
tree | 35974c37f5ff4cf9dbab0728716ccaff6f41e3b5 /activerecord/CHANGELOG.md | |
parent | c3e573db54c55c4e4ac694940c6d2f5b42b6155b (diff) | |
parent | 0bb15174558fdeaa0be1889a94347eacfc605f0b (diff) | |
download | rails-f6d0eda918756bf56e2c05afcaaabda723487017.tar.gz rails-f6d0eda918756bf56e2c05afcaaabda723487017.tar.bz2 rails-f6d0eda918756bf56e2c05afcaaabda723487017.zip |
Merge branch 'uniqueness-validation-postgresql-arrays'
When setting an array column (or other PostgreSQL-specific data type)
to be validated for uniqueness, the resulting SQL query is generated with
syntax errors, like this:
SELECT 1 AS one FROM "postgresql_arrays"
WHERE "postgresql_arrays"."nicknames" = '["john", "johnny"]' LIMIT 1
This happens because Ruby Arrays must be type-casted to their PostgreSQL
equivalent. This small patch fixes this issue, calling the adapter's
type_cast method.
Closes #8077
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 11e23ad0f4..e7d3b529fe 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,10 @@ ## Rails 4.0.0 (unreleased) ## +* Added support for `validates_uniqueness_of` in PostgreSQL array columns. + Fixes #8075. + + *Pedro Padron* + * Allow int4range and int8range columns to be created in PostgreSQL and properly convert to/from database. *Alexey Vasiliev aka leopard* |