aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-05-15 09:43:17 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-05-15 09:43:17 -0700
commit8559871cd3c3e156aafdc3799dc6234c39ba3d62 (patch)
treeefff4e9d461d556452a6923dba0fd06e5b3c235d
parent1012c3e9699471248f8554d4d5bf18e7d194ac2b (diff)
downloadrails-8559871cd3c3e156aafdc3799dc6234c39ba3d62.tar.gz
rails-8559871cd3c3e156aafdc3799dc6234c39ba3d62.tar.bz2
rails-8559871cd3c3e156aafdc3799dc6234c39ba3d62.zip
remove dead code
-rw-r--r--activesupport/lib/active_support/callbacks.rb27
1 files changed, 4 insertions, 23 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 296de94e91..bbfa74f98d 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -347,15 +347,15 @@ module ActiveSupport
def raw_filter; @filter; end
def merge(chain, new_options)
- _options = {
+ options = {
:if => @if.dup,
:unless => @unless.dup
}
- _options[:if].concat Array(new_options.fetch(:unless, []))
- _options[:unless].concat Array(new_options.fetch(:if, []))
+ options[:if].concat Array(new_options.fetch(:unless, []))
+ options[:unless].concat Array(new_options.fetch(:if, []))
- self.class.build chain, @filter, @kind, _options
+ self.class.build chain, @filter, @kind, options
end
def matches?(_kind, _filter)
@@ -451,25 +451,6 @@ module ActiveSupport
@if.map { |c| make_lambda c } +
@unless.map { |c| invert_lambda make_lambda c }
end
-
- def _normalize_legacy_filter(kind, filter)
- if !filter.respond_to?(kind) && filter.respond_to?(:filter)
- message = "Filter object with #filter method is deprecated. Define method corresponding " \
- "to filter type (#before, #after or #around)."
- ActiveSupport::Deprecation.warn message
- filter.singleton_class.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
- def #{kind}(context, &block) filter(context, &block) end
- RUBY_EVAL
- elsif filter.respond_to?(:before) && filter.respond_to?(:after) && kind == :around && !filter.respond_to?(:around)
- message = "Filter object with #before and #after methods is deprecated. Define #around method instead."
- ActiveSupport::Deprecation.warn message
- def filter.around(context)
- should_continue = before(context)
- yield if should_continue
- after(context)
- end
- end
- end
end
# An Array with a compile method.