diff --git a/web/documentserver-example/ruby/app/controllers/home_controller.rb b/web/documentserver-example/ruby/app/controllers/home_controller.rb index 9982098a1..87f5e4a23 100755 --- a/web/documentserver-example/ruby/app/controllers/home_controller.rb +++ b/web/documentserver-example/ruby/app/controllers/home_controller.rb @@ -169,7 +169,7 @@ def historyobj action_data: file_data['action_data'], direct_url: file_data['direct_url'] ) - history = file.get_history + history = file.history render(json: history) rescue StandardError render(json: '{ "error": "File not found"}') diff --git a/web/documentserver-example/ruby/app/models/file_model.rb b/web/documentserver-example/ruby/app/models/file_model.rb index 57e4a6942..d4772bc32 100755 --- a/web/documentserver-example/ruby/app/models/file_model.rb +++ b/web/documentserver-example/ruby/app/models/file_model.rb @@ -261,8 +261,7 @@ def history data_obj['url'] = if i == cur_ver DocumentHelper.get_download_url( - file_name, - true + file_name ) else DocumentHelper.get_historypath_uri( @@ -303,22 +302,20 @@ def history prev = hist_data[(i - 2).to_s] # get the history data from the previous file version # write key and url information about previous file version with optional direct url - data( - obj['previous'] = if enable_direct_url? == true - { # write key and url information about previous file version with optional directUrl - fileType: prev['fileType'], - key: prev['key'], - url: prev['url'], - directUrl: prev['directUrl'] - } - else - { - fileType: prev['fileType'], - key: prev['key'], - url: prev['url'] - } - end - ) + data_obj['previous'] = if enable_direct_url? == true + { # write key and url information about previous file version with optional directUrl + fileType: prev['fileType'], + key: prev['key'], + url: prev['url'], + directUrl: prev['directUrl'] + } + else + { + fileType: prev['fileType'], + key: prev['key'], + url: prev['url'] + } + end diff_path = [hist_dir, (i - 1).to_s, 'diff.zip'].join(File::SEPARATOR) if File.exist?(diff_path)