diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-09-07 17:16:54 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-09-07 17:16:54 -0300 |
commit | 7b9b0b531f9cb6a64737efc5c46890b4609847bf (patch) | |
tree | 22a37eeb9b3418a86b62051b9ece467a45b02443 /activerecord/lib | |
parent | 51dd2588433457960cca592d5b5dac6e0537feac (diff) | |
download | rails-7b9b0b531f9cb6a64737efc5c46890b4609847bf.tar.gz rails-7b9b0b531f9cb6a64737efc5c46890b4609847bf.tar.bz2 rails-7b9b0b531f9cb6a64737efc5c46890b4609847bf.zip |
Revert "Merge pull request #21069 from dmitry/feature/validate-multiple-contexts-at-once"
This reverts commit 51dd2588433457960cca592d5b5dac6e0537feac, reversing
changes made to ecb4e4b21b3222b823fa24d4a0598b1f2f63ecfb.
This broke Active Record tests
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/validations.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 108fe548c8..34d96b19fe 100644 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -54,7 +54,7 @@ module ActiveRecord # Validations with no <tt>:on</tt> option will run no matter the context. Validations with # some <tt>:on</tt> option will only run in the specified context. def valid?(context = nil) - context ||= default_validation_context + context ||= (new_record? ? :create : :update) output = super(context) errors.empty? && output end @@ -63,10 +63,6 @@ module ActiveRecord protected - def default_validation_context - [new_record? ? :create : :update] - end - def raise_validation_error raise(RecordInvalid.new(self)) end |