mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
REFACTOR: Simplify backup version check
Adds specs for inalid version number in metadata file.
Follow-up to c3cd2389fe
This commit is contained in:
@@ -19,11 +19,7 @@ module BackupRestore
|
||||
def validate
|
||||
metadata = extract_metadata
|
||||
|
||||
if metadata[:version].blank?
|
||||
raise MetaDataError.new("Version not defined in metadata file.")
|
||||
end
|
||||
|
||||
if !metadata[:version].is_a?(String) && !metadata[:version].is_a?(Integer)
|
||||
if !metadata[:version].is_a?(Integer)
|
||||
raise MetaDataError.new("Version is not in a valid format.")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user