From 8e236152457ed48bb436e9bffb4c5d6d4b6a26d4 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Tue, 16 Aug 2011 19:14:06 +0100 Subject: Use lazy load hooks to set parameter wrapping configuration. This means that it doesn't force Action Controller / Active Record to load, but it doesn't fail if they have already loaded. Thanks @josevalim for the hint. --- actionpack/lib/action_controller/metal/params_wrapper.rb | 2 -- actionpack/test/controller/params_wrapper_test.rb | 7 ------- 2 files changed, 9 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb index dfc4e3d72c..2d8afc3a78 100644 --- a/actionpack/lib/action_controller/metal/params_wrapper.rb +++ b/actionpack/lib/action_controller/metal/params_wrapper.rb @@ -121,8 +121,6 @@ module ActionController _set_wrapper_defaults(_wrapper_options.slice(:format).merge(options), model) end - alias :wrap_parameters= :wrap_parameters - # Sets the default wrapper key or model which will be used to determine # wrapper key and attribute names. Will be called automatically when the # module is inherited. diff --git a/actionpack/test/controller/params_wrapper_test.rb b/actionpack/test/controller/params_wrapper_test.rb index e1914cf894..7bef1e8d5d 100644 --- a/actionpack/test/controller/params_wrapper_test.rb +++ b/actionpack/test/controller/params_wrapper_test.rb @@ -180,13 +180,6 @@ class ParamsWrapperTest < ActionController::TestCase assert_parameters({ 'username' => 'sikachu', 'title' => 'Developer', 'user' => { 'username' => 'sikachu', 'title' => 'Developer' }}) end end - - def test_assignment_alias - with_default_wrapper_options do - UsersController.wrap_parameters = { :format => [:foo] } - assert_equal({ :format => [:foo], :name => "user" }, UsersController._wrapper_options) - end - end end class NamespacedParamsWrapperTest < ActionController::TestCase -- cgit v1.2.3