aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-09-29 12:34:53 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-09-29 12:34:53 -0700
commita455e3f4e9dbfb9630d47878e1239bc424fb7d13 (patch)
tree2b1f86d41899babb0856e56b1f767a289b7cd39b /activemodel
parent035cc69c48d9d538bded70fc88976cd7f23966f5 (diff)
parent796cab45561fce268aa74e6587cdb9cae3bb243e (diff)
downloadrails-a455e3f4e9dbfb9630d47878e1239bc424fb7d13.tar.gz
rails-a455e3f4e9dbfb9630d47878e1239bc424fb7d13.tar.bz2
rails-a455e3f4e9dbfb9630d47878e1239bc424fb7d13.zip
Merge pull request #17093 from phiggins/remove-dynamic-send-on-built-in-callbacks
Reduce allocations when running AR callbacks.
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 60439f5631..b5b8ce1257 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -390,7 +390,7 @@ module ActiveModel
protected
def run_validations! #:nodoc:
- run_callbacks :validate
+ run_validate_callbacks
errors.empty?
end
end
diff --git a/activemodel/lib/active_model/validations/callbacks.rb b/activemodel/lib/active_model/validations/callbacks.rb
index edfffdd3ce..e22d8a81c0 100644
--- a/activemodel/lib/active_model/validations/callbacks.rb
+++ b/activemodel/lib/active_model/validations/callbacks.rb
@@ -108,7 +108,7 @@ module ActiveModel
# Overwrite run validations to include callbacks.
def run_validations! #:nodoc:
- run_callbacks(:validation) { super }
+ run_validation_callbacks { super }
end
end
end