diff options
author | Jorge Bejar <jorge@wyeworks.com> | 2015-06-02 15:54:07 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2015-06-11 16:54:16 -0300 |
commit | cf9f2f329a589a7867b395fbc0274a90a40c9b6f (patch) | |
tree | 490ee0de76905f4eecd1007a9a651d039a211bc7 /railties | |
parent | a2c9a7308474bc1d7fc35df9560c46125d94f5a4 (diff) | |
download | rails-cf9f2f329a589a7867b395fbc0274a90a40c9b6f.tar.gz rails-cf9f2f329a589a7867b395fbc0274a90a40c9b6f.tar.bz2 rails-cf9f2f329a589a7867b395fbc0274a90a40c9b6f.zip |
Enable wrap_parameter by default in rails api applications
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt | 2 | ||||
-rw-r--r-- | railties/test/generators/api_app_generator_test.rb | 4 |
2 files changed, 1 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt index 0fc1514684..94f612c3dd 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt @@ -1,6 +1,5 @@ # Be sure to restart your server when you modify this file. -<%- unless options[:api] -%> # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. @@ -8,7 +7,6 @@ ActiveSupport.on_load(:action_controller) do wrap_parameters format: [:json] if respond_to?(:wrap_parameters) end -<%- end -%> <%- unless options.skip_active_record? -%> # To enable root element in JSON for ActiveRecord objects. diff --git a/railties/test/generators/api_app_generator_test.rb b/railties/test/generators/api_app_generator_test.rb index 94d1008aae..9978ad0da1 100644 --- a/railties/test/generators/api_app_generator_test.rb +++ b/railties/test/generators/api_app_generator_test.rb @@ -47,9 +47,7 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase assert_file "config/initializers/cors.rb" - assert_file "config/initializers/wrap_parameters.rb" do |content| - assert_no_match(/wrap_parameters/, content) - end + assert_file "config/initializers/wrap_parameters.rb" assert_file "app/controllers/application_controller.rb", /ActionController::API/ end |