diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 7fd3547b9..f4c73a6a4 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -265,8 +265,9 @@ class MyshixunsController < ApplicationController uid_logger_dubug("-- game build: file update #{@sec_key}, record id is #{record.id}, time is **** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") end # 隐藏代码文件 和 VNC的都不需要走版本库 - uid_logger_dubug("#######enter_#{@myshixun.identifier}: #{@hide_code}") - unless @hide_code || (@myshixun.shixun&.vnc_evaluate && params[:evaluate].present?) + vnc = @myshixun.shixun&.vnc + unless @hide_code || (vnc && params[:evaluate].present?) + # 远程版本库文件内容 last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"] diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index d197b6f9d..d3744fb6e 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -474,7 +474,7 @@ class ShixunsController < ApplicationController if params[:shixun][:vnc] shixun_params.merge(vnc_evaluate: 1) else - shixun_params + shixun_params.merge(vnc_evaluate: 0) end @shixun.update_attributes!(update_params) end diff --git a/db/migrate/20200213150113_modify_vnc_evalute_for_shixuns.rb b/db/migrate/20200213150113_modify_vnc_evalute_for_shixuns.rb new file mode 100644 index 000000000..682e8ad60 --- /dev/null +++ b/db/migrate/20200213150113_modify_vnc_evalute_for_shixuns.rb @@ -0,0 +1,10 @@ +class ModifyVncEvaluteForShixuns < ActiveRecord::Migration[5.2] + def change + Shixun.find_each do |shixun| + if !shixun.vnc && shixun.vnc_evaluate + puts "####shixun_id: #{shixun.id}" + shixun.update_column(:vnc_evaluate, false) + end + end + end +end