aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorGuo Xiang Tan <tgx_world@hotmail.com>2015-03-22 10:43:34 +0800
committerGuo Xiang Tan <tgx_world@hotmail.com>2015-03-22 11:21:02 +0800
commitbdc1d329d4eea823d07cf010064bd19c07099ff3 (patch)
treeca60c74fd711b4b22c688b566734d216d5d8807b /activemodel
parent2271f7db17b728234abc2ca66e6cf9a4c55d8e84 (diff)
downloadrails-bdc1d329d4eea823d07cf010064bd19c07099ff3.tar.gz
rails-bdc1d329d4eea823d07cf010064bd19c07099ff3.tar.bz2
rails-bdc1d329d4eea823d07cf010064bd19c07099ff3.zip
Revert "Reduce allocations when running AR callbacks."
This reverts commit 796cab45561fce268aa74e6587cdb9cae3bb243e.
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/validations.rb2
-rw-r--r--activemodel/lib/active_model/validations/callbacks.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index 176d4c0607..74d60327d6 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -401,7 +401,7 @@ module ActiveModel
protected
def run_validations! #:nodoc:
- _run_validate_callbacks
+ run_callbacks :validate
errors.empty?
end
diff --git a/activemodel/lib/active_model/validations/callbacks.rb b/activemodel/lib/active_model/validations/callbacks.rb
index 4b58ef66e3..b4301c23e4 100644
--- a/activemodel/lib/active_model/validations/callbacks.rb
+++ b/activemodel/lib/active_model/validations/callbacks.rb
@@ -109,7 +109,7 @@ module ActiveModel
# Overwrite run validations to include callbacks.
def run_validations! #:nodoc:
- _run_validation_callbacks { super }
+ run_callbacks(:validation) { super }
end
end
end