From 57bc25c5f8129f57b08a2dc7c319b86778dd8a40 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Sun, 9 Jan 2011 10:15:05 -0800 Subject: Use run_callbacks; the generated _run__callbacks method is not a public interface. Signed-off-by: Santiago Pastorino --- activemodel/lib/active_model/callbacks.rb | 5 +---- activemodel/lib/active_model/validations.rb | 2 +- activemodel/lib/active_model/validations/callbacks.rb | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/callbacks.rb b/activemodel/lib/active_model/callbacks.rb index 7302a869c8..2a1f51a9a7 100644 --- a/activemodel/lib/active_model/callbacks.rb +++ b/activemodel/lib/active_model/callbacks.rb @@ -24,14 +24,11 @@ module ActiveModel # you want callbacks on in a block so that the callbacks get a chance to fire: # # def create - # _run_create_callbacks do + # run_callbacks :create do # # Your create action methods here # end # end # - # The _run__callbacks methods are dynamically created when you extend - # the ActiveModel::Callbacks module. - # # Then in your class, you can use the +before_create+, +after_create+ and +around_create+ # methods, just as you would in an Active Record module. # diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb index 6cb015a144..cdf23c7b1b 100644 --- a/activemodel/lib/active_model/validations.rb +++ b/activemodel/lib/active_model/validations.rb @@ -207,7 +207,7 @@ module ActiveModel protected def run_validations! - _run_validate_callbacks + run_callbacks :validate errors.empty? end end diff --git a/activemodel/lib/active_model/validations/callbacks.rb b/activemodel/lib/active_model/validations/callbacks.rb index 621518de5b..adc2867ad0 100644 --- a/activemodel/lib/active_model/validations/callbacks.rb +++ b/activemodel/lib/active_model/validations/callbacks.rb @@ -50,7 +50,7 @@ module ActiveModel # Overwrite run validations to include callbacks. def run_validations! - _run_validation_callbacks { super } + run_callbacks(:validation) { super } end end end -- cgit v1.2.3