From 31f583855a5607a79258d0822db40c11b0564adb Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 23 Jul 2019 12:41:57 -0400 Subject: [PATCH] DEV: pull static check out of loop * followup to 08b28680 * as per https://review.discourse.org/t/4713/2 --- lib/backup_restore/restorer.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/backup_restore/restorer.rb b/lib/backup_restore/restorer.rb index f183c2ce8c2..701c72e7d48 100644 --- a/lib/backup_restore/restorer.rb +++ b/lib/backup_restore/restorer.rb @@ -11,6 +11,11 @@ module BackupRestore attr_reader :success def self.pg_produces_portable_dump?(version) + # anything pg 11 or above will produce a non-portable dump + return false if version.to_i >= 11 + + # below 11, the behaviour was changed in multiple different minor + # versions depending on major release line - we list those versions below gem_version = Gem::Version.new(version) %w{ @@ -20,8 +25,6 @@ module BackupRestore 9.4.17 9.3.22 }.each do |unportable_version| - # anything pg 11 or above will produce a non-portable dump - return false if version.to_i >= 11 return false if Gem::Dependency.new("", "~> #{unportable_version}").match?("", gem_version) end