change commits committer

This commit is contained in:
sylor_huang@126.com 2020-06-02 16:06:51 +08:00
parent 858ead3464
commit fa17a2eb7f
2 changed files with 3 additions and 4 deletions

View File

@ -96,7 +96,7 @@ class User < ApplicationRecord
where("LOWER(concat(lastname, firstname, login, mail)) LIKE ?", "%#{keywords.split(" ").join('|')}%") unless keywords.blank? where("LOWER(concat(lastname, firstname, login, mail)) LIKE ?", "%#{keywords.split(" ").join('|')}%") unless keywords.blank?
} }
scope :simple_select, -> {select(:id, :login, :lastname,:firstname, :nickname)} scope :simple_select, -> {select(:id, :login, :lastname,:firstname, :nickname, :gitea_uid)}
attr_accessor :password, :password_confirmation attr_accessor :password, :password_confirmation

View File

@ -5,11 +5,10 @@ else
json.total_count @hash_commit[:total_count] json.total_count @hash_commit[:total_count]
json.commits do json.commits do
json.array! @hash_commit[:body] do |commit| json.array! @hash_commit[:body] do |commit|
Rails.logger.info("#######______commit______#########{commit}")
commiter = commit['committer'] commiter = commit['committer']
if commiter.present? if commiter.present?
commit_user = commiter['name'] commit_user_id = commiter['id']
forge_user = User.simple_select.find_by(login: commit_user) forge_user = User.simple_select.find_by(gitea_uid: commit_user_id)
end end
json.sha commit['sha'] json.sha commit['sha']
json.message commit['commit']['message'] json.message commit['commit']['message']