diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-03-09 21:22:12 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-03-09 23:09:00 +0100 |
commit | ad1a24f0e04ccff17df604c7781f4805ace2ec0f (patch) | |
tree | b1c9b814eff78b9ac15cb24f3710072f6dbfe9da /activerecord/CHANGELOG.md | |
parent | 15970efb2acc7767f2f20c5d649e53ace2e2ddb5 (diff) | |
download | rails-ad1a24f0e04ccff17df604c7781f4805ace2ec0f.tar.gz rails-ad1a24f0e04ccff17df604c7781f4805ace2ec0f.tar.bz2 rails-ad1a24f0e04ccff17df604c7781f4805ace2ec0f.zip |
Uniqueness validation uses a proc to specify the `:conditions` option.
This is a follow up to #5321 and follows the general direction in
AR to make things lazy evaluated.
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 1796f4319f..b089f9177e 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,14 @@ ## Rails 4.0.0 (unreleased) ## +* Uniqueness validation allows you to pass `:conditions` to limit + the constraint lookup. + + Example: + + validates_uniqueness_of :title, conditions: -> { where('approved = ?', true) } + + *Mattias Pfeiffer + Yves Senn* + * `connection` is deprecated as an instance method. This allows end-users to have a `connection` method on their models without clashing with ActiveRecord internals. |