Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Integrate strong_parameters by default

  • Loading branch information...
commit 2a4b48d75502e4a63b60fa95c41d1c1ceff0f16a 1 parent e28b6f5
@guilleiguaran authored
View
3  railties/CHANGELOG.md
@@ -1,5 +1,8 @@
## Rails 4.0.0 (unreleased) ##
+* Add strong_parameters to default Gemfile, new generated controllers
+ will use it by default. *Guillermo Iguaran*
+
* The application generator generates `public/humans.txt` with some basic data. *Paul Campbell*
* Add `config.queue_consumer` to allow the default consumer to be configurable. *Carlos Antonio da Silva*
View
3  railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -9,6 +9,9 @@ source 'https://rubygems.org'
<%= assets_gemfile_entry %>
<%= javascript_gemfile_entry %>
+# To whitelist permissible parameters in controllers
+gem 'strong_parameters'
+
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
View
7 railties/test/generators/app_generator_test.rb
@@ -308,6 +308,13 @@ def test_inclusion_of_debugger
end
end
+ def test_inclusion_of_strong_parameters
+ run_generator
+ assert_file "Gemfile" do |contents|
+ assert_match(/gem 'strong_parameters'/, contents)
+ end
+ end
+
def test_template_from_dir_pwd
FileUtils.cd(Rails.root)
assert_match(/It works from file!/, run_generator([destination_root, "-m", "lib/template.rb"]))
Please sign in to comment.
Something went wrong with that request. Please try again.