diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-03-09 14:11:21 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-03-09 14:11:21 -0800 |
commit | bbc87dbc81eecd48567ab06810c6d5d8d9be5573 (patch) | |
tree | 1e19c7a7fececd91043e99ea4bfa23aecefb751e /activerecord/CHANGELOG.md | |
parent | ddd034f3a6570d3522471fbe173162a24879df4b (diff) | |
parent | ad1a24f0e04ccff17df604c7781f4805ace2ec0f (diff) | |
download | rails-bbc87dbc81eecd48567ab06810c6d5d8d9be5573.tar.gz rails-bbc87dbc81eecd48567ab06810c6d5d8d9be5573.tar.bz2 rails-bbc87dbc81eecd48567ab06810c6d5d8d9be5573.zip |
Merge pull request #9633 from senny/5321_make_it_lazy
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 093e9ff6d2..33ba77bca2 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 Active Record internals. |