mirror of https://github.com/rails/rails
Merge pull request #24001 from 5t111111/fix-gsub-cookies_serializer
Fix description in cookies_serializer.rb being corrupted by gsub when updating
This commit is contained in:
commit
9a1cc04c90
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue