Permalink
Browse files

__define_callbacks method is not necessary anymore

  • Loading branch information...
1 parent d1316bb commit a3e9d6bb22774c3f7ec22c3f8bfeabf56ed8436d @tenderlove tenderlove committed May 10, 2013
Showing with 1 addition and 8 deletions.
  1. +1 −8 activesupport/lib/active_support/callbacks.rb
@@ -76,7 +76,7 @@ module Callbacks
# save
# end
def run_callbacks(kind, &block)
- runner = self.class.__define_callbacks(kind, self)
+ runner = send("_#{kind}_callbacks").compile
e = Filters::Environment.new(self, false, nil, block)
runner.call(e).value
end
@@ -427,13 +427,6 @@ def remove_duplicates(callback)
module ClassMethods
- # This method defines callback chain method for the given kind
- # if it was not yet defined.
- # This generated method plays caching role.
- def __define_callbacks(kind, object) #:nodoc:
- object.send("_#{kind}_callbacks").compile
- end
-
def __reset_runner(symbol)
name = __callback_runner_name(symbol)
undef_method(name) if method_defined?(name)

0 comments on commit a3e9d6b

Please sign in to comment.