mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:01:18 +08:00
REFACTOR: Simplify backup version check
Adds specs for inalid version number in metadata file. Follow-up to c3cd2389fee19ba209d99192ceda99b3cd3e5578
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