Skip to content
This repository
Browse code

Merge branch 'master' of github.com:rails/rails

  • Loading branch information...
commit 98fac9902b3cc8984ad6645e0db390fb8cb55098 2 parents 0245792 + 8e23615
Xavier Noria authored August 16, 2011
2  actionpack/lib/action_controller/metal/params_wrapper.rb
@@ -121,8 +121,6 @@ def wrap_parameters(name_or_model_or_options, options = {})
121 121
         _set_wrapper_defaults(_wrapper_options.slice(:format).merge(options), model)
122 122
       end
123 123
 
124  
-      alias :wrap_parameters= :wrap_parameters
125  
-
126 124
       # Sets the default wrapper key or model which will be used to determine
127 125
       # wrapper key and attribute names. Will be called automatically when the
128 126
       # module is inherited.
7  actionpack/test/controller/params_wrapper_test.rb
@@ -180,13 +180,6 @@ def test_not_wrapping_abstract_model
180 180
       assert_parameters({ 'username' => 'sikachu', 'title' => 'Developer', 'user' => { 'username' => 'sikachu', 'title' => 'Developer' }})
181 181
     end
182 182
   end
183  
-
184  
-  def test_assignment_alias
185  
-    with_default_wrapper_options do
186  
-      UsersController.wrap_parameters = { :format => [:foo] }
187  
-      assert_equal({ :format => [:foo], :name => "user" }, UsersController._wrapper_options)
188  
-    end
189  
-  end
190 183
 end
191 184
 
192 185
 class NamespacedParamsWrapperTest < ActionController::TestCase
16  railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
@@ -3,12 +3,14 @@
3 3
 # This file contains settings for ActionController::ParamsWrapper which
4 4
 # is enabled by default.
5 5
 
6  
-<%= app_const %>.configure do
7  
-  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
8  
-  config.action_controller.wrap_parameters = { <%= key_value :format, "[:json]" %> }
  6
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
  7
+ActiveSupport.on_load(:action_controller) do
  8
+  wrap_parameters <%= key_value :format, "[:json]" %>
  9
+end
9 10
 
10  
-  <%- unless options.skip_active_record? -%>
11  
-  # Disable root element in JSON by default.
12  
-  config.active_record.include_root_in_json = false
13  
-  <%- end -%>
  11
+<%- unless options.skip_active_record? -%>
  12
+# Disable root element in JSON by default.
  13
+ActiveSupport.on_load(:active_record) do
  14
+  self.include_root_in_json = false
14 15
 end
  16
+<%- end -%>

0 notes on commit 98fac99

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