aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-09-07 16:46:18 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-09-07 16:46:18 -0300
commit51dd2588433457960cca592d5b5dac6e0537feac (patch)
treeb28ab98e1d42e2f3f784f39a1ec82330143d7685 /activemodel/lib
parentecb4e4b21b3222b823fa24d4a0598b1f2f63ecfb (diff)
parent86e3b047ba0349bd88952d4e54504327c3f7e59c (diff)
downloadrails-51dd2588433457960cca592d5b5dac6e0537feac.tar.gz
rails-51dd2588433457960cca592d5b5dac6e0537feac.tar.bz2
rails-51dd2588433457960cca592d5b5dac6e0537feac.zip
Merge pull request #21069 from dmitry/feature/validate-multiple-contexts-at-once
Validate multiple contexts on `valid?` and `invalid?` at once
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/validations.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index 5f1dde4aa3..f23c920d87 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -162,7 +162,7 @@ module ActiveModel
options = options.dup
options[:if] = Array(options[:if])
options[:if].unshift ->(o) {
- Array(options[:on]).include?(o.validation_context)
+ !(Array(options[:on]) & Array(o.validation_context)).empty?
}
end