diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 689c05ded4..0548284186 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -99,10 +99,12 @@ module ActiveSupport class Object < Callback def matches?(_kind, _filter) + return false unless super + if !_filter.is_a?(String) - super && @filter.to_s.start_with?(_method_name_for_object_filter(_kind, _filter, false)) + @filter.to_s.start_with?(_method_name_for_object_filter(_kind, _filter, false)) else - super && @filter == _filter + @filter == _filter end end end @@ -163,6 +165,8 @@ module ActiveSupport end def duplicates?(other) + return false unless self.class == other.class + matches?(other.kind, other.filter) end |