diff options
author | Hirofumi Wakasugi <baenej@gmail.com> | 2016-03-02 18:33:01 +0900 |
---|---|---|
committer | Hirofumi Wakasugi <baenej@gmail.com> | 2016-03-02 18:33:01 +0900 |
commit | 9f7127350448342c8ebbadc193f13fcd35ac3eb7 (patch) | |
tree | acf8bd79e62da1f508ce941294f454bc0c4b4f93 /railties | |
parent | 1fdc83947be8b7e8838419a72f6f7b71ee63ac35 (diff) | |
download | rails-9f7127350448342c8ebbadc193f13fcd35ac3eb7.tar.gz rails-9f7127350448342c8ebbadc193f13fcd35ac3eb7.tar.bz2 rails-9f7127350448342c8ebbadc193f13fcd35ac3eb7.zip |
Fix description in cookies_serializer.rb being corrupted when updating
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index f4d2aa761b..e9435c946a 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -103,7 +103,7 @@ module Rails end unless cookie_serializer_config_exist - gsub_file 'config/initializers/cookies_serializer.rb', /json/, 'marshal' + gsub_file 'config/initializers/cookies_serializer.rb', /json(?!,)/, 'marshal' end unless active_record_belongs_to_required_by_default_config_exist diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 11b795bc9f..44259c80cc 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -210,7 +210,8 @@ class AppGeneratorTest < Rails::Generators::TestCase generator = Rails::Generators::AppGenerator.new ["rails"], { with_dispatchers: true }, destination_root: app_root, shell: @shell generator.send(:app_const) quietly { generator.send(:update_config_files) } - assert_file("#{app_root}/config/initializers/cookies_serializer.rb", /Rails\.application\.config\.action_dispatch\.cookies_serializer = :marshal/) + assert_file("#{app_root}/config/initializers/cookies_serializer.rb", + /Valid options are :json, :marshal, and :hybrid\.\nRails\.application\.config\.action_dispatch\.cookies_serializer = :marshal/) end end |