Skip to content
This repository
Browse code

replace present? with any? to reduce dependency on AS

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

1 comment on commit 9a64ffc

Rafael Mendonça França

Is not better to check empty??

any? will loop on each element.

Please sign in to comment.
Something went wrong with that request. Please try again.