From b2961dad2b1579b9a14508c82817e3f3f0fb9462 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 20 Dec 2023 22:25:23 +0100 Subject: [PATCH] Fix lint issue in glitch-soc-only file --- config/initializers/0_duplicate_migrations.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/0_duplicate_migrations.rb b/config/initializers/0_duplicate_migrations.rb index e99b5f1392..ab50e5e900 100644 --- a/config/initializers/0_duplicate_migrations.rb +++ b/config/initializers/0_duplicate_migrations.rb @@ -21,7 +21,7 @@ module ActiveRecord def self.new(direction, migrations, schema_migration, internal_metadata, target_version = nil) migrated = Set.new(Base.connection.migration_context.get_all_versions) - migrations.group_by(&:name).each do |_name, duplicates| + migrations.group_by(&:name).each_value do |duplicates| next unless duplicates.length > 1 && duplicates.all? { |m| ALLOWED_DUPLICATES.include?(m.version) } # We have a set of allowed duplicates. Keep the migrated one, if any. @@ -47,7 +47,7 @@ module ActiveRecord # A set of duplicated migrations is considered migrated if at least one of # them is migrated. migrated = get_all_versions - migrations.group_by(&:name).each do |_name, duplicates| + migrations.group_by(&:name).each_value do |duplicates| return true unless duplicates.any? { |m| migrated.include?(m.version.to_i) } end false