Browse Source

fix

pull/343/head
chenjing 3 years ago
parent
commit
325f345381
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      app/models/user_cla.rb

+ 5
- 5
app/models/user_cla.rb View File

@@ -30,8 +30,8 @@ class UserCla < ApplicationRecord
fresh_pull_request
end

def self.build(params,user_id)
self.create!(user_id: user_id,
def self.build(params,current_user_id)
self.create!(user_id: current_user_id,
cla_id: params[:cla_id],
real_name: params[:real_name],
email: params[:email],
@@ -40,11 +40,11 @@ class UserCla < ApplicationRecord
end

def fresh_pull_request
gitea_ids = Project.where(user_id: cla.user_id).pluck(:gpid)
project_ids = cla.organization.projects.pluck(:id)
if state == "signed"
PullRequest.where(user_id: user_id, gitea_id: gitea_ids, status:3).update_all(status:0)
PullRequest.where(user_id: user_id, project_id: project_ids, status:3).update_all(status:0)
else
PullRequest.where(user_id: user_id, gitea_id: gitea_ids, status:0).update_all(status:3)
PullRequest.where(user_id: user_id, project_id: project_ids, status:0).update_all(status:3)
end
end



Loading…
Cancel
Save