aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-09 14:11:21 -0800
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-09 14:11:21 -0800
commitbbc87dbc81eecd48567ab06810c6d5d8d9be5573 (patch)
tree1e19c7a7fececd91043e99ea4bfa23aecefb751e /activerecord/CHANGELOG.md
parentddd034f3a6570d3522471fbe173162a24879df4b (diff)
parentad1a24f0e04ccff17df604c7781f4805ace2ec0f (diff)
downloadrails-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.md9
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.