aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-27 18:16:55 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-01 17:31:01 -0700
commit34509777fd375e5bc529f21ca66cf63263c2cf64 (patch)
treeb553841b1ac6777eb06a864e44bacd7ed2966772 /activesupport/lib/active_support
parent3be3470fab788856b4559742434f195cc6b1009a (diff)
downloadrails-34509777fd375e5bc529f21ca66cf63263c2cf64.tar.gz
rails-34509777fd375e5bc529f21ca66cf63263c2cf64.tar.bz2
rails-34509777fd375e5bc529f21ca66cf63263c2cf64.zip
Makes new callbacks support keys with special characters
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/new_callbacks.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/new_callbacks.rb b/activesupport/lib/active_support/new_callbacks.rb
index 7a48dbac04..8a91e1c674 100644
--- a/activesupport/lib/active_support/new_callbacks.rb
+++ b/activesupport/lib/active_support/new_callbacks.rb
@@ -356,6 +356,7 @@ module ActiveSupport
str = <<-RUBY_EVAL
def _run_#{symbol}_callbacks(key = nil)
if key
+ key = key.hash.to_s.gsub(/-/, '_')
name = "_run__\#{self.class.name.split("::").last}__#{symbol}__\#{key}__callbacks"
if respond_to?(name)