diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-05 13:54:40 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-05 13:54:40 -0800 |
commit | 798b5efedb7c6f10e606cf87546af34c1744e76f (patch) | |
tree | 096b03b0972a630ec54e91840123a8a0eca76540 /actionpack/lib/action_controller/metal | |
parent | 4751cc21e8893f1cec827c8dcdf876db43e91556 (diff) | |
parent | 2e487bc65816b1dec3d444a8a6f80aaef7eb68d3 (diff) | |
download | rails-798b5efedb7c6f10e606cf87546af34c1744e76f.tar.gz rails-798b5efedb7c6f10e606cf87546af34c1744e76f.tar.bz2 rails-798b5efedb7c6f10e606cf87546af34c1744e76f.zip |
Merge pull request #4333 from rafaelfranca/patch-1
Change more Array.wrap calls
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/helpers.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/params_wrapper.rb | 11 |
2 files changed, 6 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/metal/helpers.rb b/actionpack/lib/action_controller/metal/helpers.rb index 50d7aac300..d070eaae5d 100644 --- a/actionpack/lib/action_controller/metal/helpers.rb +++ b/actionpack/lib/action_controller/metal/helpers.rb @@ -1,4 +1,3 @@ -require 'active_support/core_ext/array/wrap' require 'active_support/core_ext/class/attribute' module ActionController @@ -94,7 +93,7 @@ module ActionController def all_helpers_from_path(path) helpers = [] - Array.wrap(path).each do |_path| + Array(path).each do |_path| extract = /^#{Regexp.quote(_path.to_s)}\/?(.*)_helper.rb$/ helpers += Dir["#{_path}/**/*_helper.rb"].map { |file| file.sub(extract, '\1') } end diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb index 5c28a8074f..fa760f2658 100644 --- a/actionpack/lib/action_controller/metal/params_wrapper.rb +++ b/actionpack/lib/action_controller/metal/params_wrapper.rb @@ -1,7 +1,6 @@ require 'active_support/core_ext/class/attribute' require 'active_support/core_ext/hash/slice' require 'active_support/core_ext/hash/except' -require 'active_support/core_ext/array/wrap' require 'active_support/core_ext/module/anonymous' require 'action_dispatch/http/mime_types' @@ -43,9 +42,9 @@ module ActionController # wrap_parameters :person, :include => [:username, :password] # end # - # On ActiveRecord models with no +:include+ or +:exclude+ option set, + # On ActiveRecord models with no +:include+ or +:exclude+ option set, # if attr_accessible is set on that model, it will only wrap the accessible - # parameters, else it will only wrap the parameters returned by the class + # parameters, else it will only wrap the parameters returned by the class # method attribute_names. # # If you're going to pass the parameters to an +ActiveModel+ object (such as @@ -180,9 +179,9 @@ module ActionController controller_name.singularize end - options[:include] = Array.wrap(options[:include]).collect(&:to_s) if options[:include] - options[:exclude] = Array.wrap(options[:exclude]).collect(&:to_s) if options[:exclude] - options[:format] = Array.wrap(options[:format]) + options[:include] = Array(options[:include]).collect(&:to_s) if options[:include] + options[:exclude] = Array(options[:exclude]).collect(&:to_s) if options[:exclude] + options[:format] = Array(options[:format]) self._wrapper_options = options end |