From e02ec7a945b5824f2c05f3735c5d69df2c4a41b3 Mon Sep 17 00:00:00 2001 From: Tim Fischbach Date: Wed, 17 Jan 2024 14:07:46 +0100 Subject: [PATCH] Fix CI for Rails 7.1.3 `rake db:create:all` still isn't fixed (see [1]). Adapt template so that we no longer need the development database. [1] https://github.com/rails/rails/issues/50038 --- spec/support/pageflow/dummy/rails_template.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spec/support/pageflow/dummy/rails_template.rb b/spec/support/pageflow/dummy/rails_template.rb index afe13c904..75aa4695b 100644 --- a/spec/support/pageflow/dummy/rails_template.rb +++ b/spec/support/pageflow/dummy/rails_template.rb @@ -14,7 +14,7 @@ def source_paths rails_version_string = Rails::VERSION::STRING.tr!('.', '_') -engine_name = ENV.fetch('PAGEFLOW_PLUGIN_ENGINE', 'pageflow') +engine_name = ENV['PAGEFLOW_PLUGIN_ENGINE'].presence || 'pageflow' database_prefix = "#{engine_name}-rails-#{rails_version_string}" gsub_file('config/database.yml', @@ -45,8 +45,7 @@ def source_paths in_root { run('rake db:environment:set db:drop:all', capture: true, abort_on_failure: false) } -rake 'db:create' # workaround for https://github.com/rails/rails/issues/50038 -rake 'db:create:all' +rake 'db:create' # Install Webpacker @@ -106,4 +105,4 @@ def source_paths copy_file('add_custom_fields.rb', 'db/migrate/99990000000000_add_custom_fields.rb') -rake 'db:migrate db:test:load_schema', env: 'development' +rake 'db:migrate'