aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/callbacks.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-05-10 11:08:25 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-05-10 11:08:25 -0700
commitc5ed42a60281c24c34a0f7b28a72835a52ea7fc7 (patch)
treebdf4fa9788d9f602f20f636ee7eee9c43c325808 /activesupport/lib/active_support/callbacks.rb
parenta3e9d6bb22774c3f7ec22c3f8bfeabf56ed8436d (diff)
downloadrails-c5ed42a60281c24c34a0f7b28a72835a52ea7fc7.tar.gz
rails-c5ed42a60281c24c34a0f7b28a72835a52ea7fc7.tar.bz2
rails-c5ed42a60281c24c34a0f7b28a72835a52ea7fc7.zip
callback chain is in charge of the cache, so remove method based cache
Diffstat (limited to 'activesupport/lib/active_support/callbacks.rb')
-rw-r--r--activesupport/lib/active_support/callbacks.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 715e4cf8a1..faa24d09de 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -427,23 +427,6 @@ module ActiveSupport
module ClassMethods
- def __reset_runner(symbol)
- name = __callback_runner_name(symbol)
- undef_method(name) if method_defined?(name)
- end
-
- def __callback_runner_name_cache
- @__callback_runner_name_cache ||= ThreadSafe::Cache.new {|cache, kind| cache[kind] = __generate_callback_runner_name(kind) }
- end
-
- def __generate_callback_runner_name(kind)
- "_run__#{self.name.hash.abs}__#{kind}__callbacks"
- end
-
- def __callback_runner_name(kind)
- __callback_runner_name_cache[kind]
- end
-
# This is used internally to append, prepend and skip callbacks to the
# CallbackChain.
def __update_callbacks(name, filters = [], block = nil) #:nodoc:
@@ -454,7 +437,6 @@ module ActiveSupport
([self] + ActiveSupport::DescendantsTracker.descendants(self)).reverse.each do |target|
chain = target.send("_#{name}_callbacks")
yield target, chain.dup, type, filters, options
- target.__reset_runner(name)
end
end
@@ -539,12 +521,9 @@ module ActiveSupport
chain = target.send("_#{symbol}_callbacks").dup
callbacks.each { |c| chain.delete(c) }
target.send("_#{symbol}_callbacks=", chain)
- target.__reset_runner(symbol)
end
self.send("_#{symbol}_callbacks=", callbacks.dup.clear)
-
- __reset_runner(symbol)
end
# Define sets of events in the object lifecycle that support callbacks.