From 63f82bd142cee969917ab9424e24bdd5ccb1bc74 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Wed, 3 Mar 2021 08:22:32 +0100 Subject: [PATCH] Add gem to watch after data migrations > This gem prevents Rails from auto-loading app code while it's running migrations, preventing the common mistake of referencing ActiveRecord models from migration code. This will make us stop relying on @mkllnk to have robust data migrations that don't cause trouble in the future. --- Gemfile | 2 ++ Gemfile.lock | 4 ++++ Gemfile_next.lock | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/Gemfile b/Gemfile index a83014ef03..01053ac9a7 100644 --- a/Gemfile +++ b/Gemfile @@ -135,6 +135,8 @@ gem 'select2-rails', '~> 3.4.7' gem 'ofn-qz', github: 'openfoodfoundation/ofn-qz', branch: 'ofn-rails-4' +gem 'good_migrations' + group :production, :staging do gem 'ddtrace' gem 'unicorn-worker-killer' diff --git a/Gemfile.lock b/Gemfile.lock index 81694a9a82..dbe263c725 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -388,6 +388,9 @@ GEM globalid (0.4.2) activesupport (>= 4.2.0) gmaps4rails (2.1.2) + good_migrations (0.0.2) + activerecord (>= 3.1) + railties (>= 3.1) haml (5.2.1) temple (>= 0.8.0) tilt @@ -771,6 +774,7 @@ DEPENDENCIES fuubar (~> 2.5.1) geocoder gmaps4rails + good_migrations haml highline (= 2.0.3) i18n diff --git a/Gemfile_next.lock b/Gemfile_next.lock index 3f9065b3b1..12ec1b7a2a 100644 --- a/Gemfile_next.lock +++ b/Gemfile_next.lock @@ -225,6 +225,9 @@ GEM globalid (0.4.2) activesupport (>= 4.2.0) gmaps4rails (2.1.2) + good_migrations (0.0.2) + activerecord (>= 3.1) + railties (>= 3.1) haml (5.2.0) temple (>= 0.8.0) tilt @@ -596,6 +599,7 @@ DEPENDENCIES fuubar (~> 2.5.1) geocoder gmaps4rails + good_migrations haml highline (= 2.0.3) i18n