# Returns the disk_path value before the execution
attr_reader:old_disk_path
# Returns the disk_path value after the execution
attr_reader:new_disk_path
# Returns the logger currently in use
attr_reader:logger
# Return whether this operation was skipped or not
#
# @return [Boolean] true if skipped of false otherwise
defskipped?
@skipped
end
protected
defmove_folder!(old_path,new_path)
unlessFile.directory?(old_path)
logger.info("Skipped attachments move from '#{old_path}' to '#{new_path}', source path doesn't exist or is not a directory (PROJECT_ID=#{project.id})")
@skipped=true
returntrue
end
ifFile.exist?(new_path)
logger.error("Cannot move attachments from '#{old_path}' to '#{new_path}', target path already exist (PROJECT_ID=#{project.id})")
# Return whether this operation was skipped or not
# This is used in EE for Geo to decide if an event will be triggered or not
#
# @return [Boolean] true if skipped of false otherwise
defskipped?
@skipped
end
private
defmove_folder!(old_path,new_path)
unlessFile.directory?(old_path)
logger.info("Skipped attachments migration from '#{old_path}' to '#{new_path}', source path doesn't exist or is not a directory (PROJECT_ID=#{project.id})")
@skipped=true
returntrue
end
ifFile.exist?(new_path)
logger.error("Cannot migrate attachments from '#{old_path}' to '#{new_path}', target path already exist (PROJECT_ID=#{project.id})")
# Returns the disk_path value before the execution
# This is used in EE for Geo
attr_reader:old_disk_path
# Returns the diks_path value after the execution
# This is used in EE for Geo
attr_reader:new_disk_path
# Returns the logger currently in use
attr_reader:logger
definitialize(project,logger: nil)
definitialize(project,logger: nil)
@project=project
@project=project
@logger=logger||Rails.logger
@logger=logger||Rails.logger
...
@@ -38,38 +25,6 @@ module Projects
...
@@ -38,38 +25,6 @@ module Projects
result
result
end
end
# Return whether this operation was skipped or not
# This is used in EE for Geo to decide if an event will be triggered or not
#
# @return [Boolean] true if skipped of false otherwise
defskipped?
@skipped
end
private
defmove_folder!(old_path,new_path)
unlessFile.directory?(old_path)
logger.info("Skipped attachments rollback from '#{old_path}' to '#{new_path}', source path doesn't exist or is not a directory (PROJECT_ID=#{project.id})")
@skipped=true
returntrue
end
ifFile.exist?(new_path)
logger.error("Cannot rollback attachments from '#{old_path}' to '#{new_path}', target path already exist (PROJECT_ID=#{project.id})")