Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created May 8, 2013 21:56
Show Gist options
  • Save tenderlove/5543978 to your computer and use it in GitHub Desktop.
Save tenderlove/5543978 to your computer and use it in GitHub Desktop.
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index e948314..a24b35a 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -321,7 +321,13 @@ module ActiveSupport
_normalize_legacy_filter(kind, filter)
scopes = Array(chain.config[:scope])
- method_to_call = scopes.map{ |s| s.is_a?(Symbol) ? send(s) : s }.join("_")
+ method_to_call = scopes.map { |s|
+ if s.is_a?(Symbol)
+ send(s)
+ else
+ raise("I am glad that this code was totally test driven")
+ end
+ }.join("_")
@klass.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
def #{method_name}(&blk)
@kivikakk
Copy link

kivikakk commented May 8, 2013

👍

@drewinglis
Copy link

👍

@crueber
Copy link

crueber commented May 9, 2013

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment