Fix weird edge case in load_schema

lolsob-rspec
Thibaut Girka 2019-11-20 19:19:32 +01:00
parent 8a037844d5
commit 06b56ac4b7
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ module ActiveRecord
# We have a set of allowed duplicates. Keep the migrated one, if any.
non_migrated = duplicates.reject { |m| migrated.include?(m.version.to_i) }
if duplicates.length == non_migrated.length
if duplicates.length == non_migrated.length || non_migrated.length == 0
# There weren't any migrated one, so we have to pick one “canonical” migration
migrations = migrations - duplicates[1..-1]
else