Permalink
Browse files

object based callbacks cannot be duplicated

  • Loading branch information...
1 parent d4dcd6e commit 95e7e56efcad98b6b89e407ced78512ea16268e6 @tenderlove tenderlove committed May 9, 2013
Showing with 4 additions and 7 deletions.
  1. +4 −7 activesupport/lib/active_support/callbacks.rb
@@ -89,21 +89,18 @@ def halted_callback_hook(filter)
end
class Callback #:nodoc:#
- class Basic < Callback
- end
-
- class Object < Callback
+ class Unduplicable < Callback # :nodoc:
def duplicates?(other)
false
end
end
def self.build(chain, filter, kind, options, _klass)
klass = case filter
- when Array, Symbol, String
- Callback::Basic
+ when Symbol, String
+ Callback
else
- Callback::Object
+ Callback::Unduplicable
end
klass.new chain, filter, kind, options, _klass
end

0 comments on commit 95e7e56

Please sign in to comment.