Permalink
Browse files

replace present? with any? to reduce dependency on AS

  • Loading branch information...
1 parent 3c5c93b commit 9a64ffc0c77c2b614401fad665ae2edb33c754a7 @tenderlove tenderlove committed Nov 13, 2012
View
1 actionpack/lib/action_controller/base.rb
@@ -1,4 +1,5 @@
require "action_controller/log_subscriber"
+require "action_controller/metal/params_wrapper"
module ActionController
# Action Controllers are the core of a web request in \Rails. They are made up of one or more actions that are executed
View
2 actionpack/lib/action_controller/metal/params_wrapper.rb
@@ -126,7 +126,7 @@ def wrap_parameters(name_or_model_or_options, options = {})
# wrapper key and attribute names. Will be called automatically when the
# module is inherited.
def inherited(klass)
- if klass._wrapper_options[:format].present?
+ if klass._wrapper_options[:format].any?
klass._set_wrapper_defaults(klass._wrapper_options.slice(:format))
end
super

1 comment on commit 9a64ffc

@rafaelfranca
Ruby on Rails member

Is not better to check empty??

any? will loop on each element.

Please sign in to comment.