Skip to content

Commit

Permalink
Fix lint issue in glitch-soc-only file
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire committed Dec 20, 2023
1 parent 01e77a0 commit b2961da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/initializers/0_duplicate_migrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Migrator
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.
Expand All @@ -47,7 +47,7 @@ def needs_migration?
# 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
Expand Down

0 comments on commit b2961da

Please sign in to comment.