25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'app/models/hubstats/comment.rb', line 25
def self.create_or_update()
= .to_h.with_indifferent_access if .respond_to? :to_h
user = Hubstats::User.create_or_update([:user])
[:user_id] = user.id
if [:pull_number]
pull_request = Hubstats::PullRequest.belonging_to_repo([:repo_id]).where(number: [:pull_number]).first
if pull_request
[:pull_request_id] = pull_request.id
end
end
= .slice(*Hubstats::Comment.column_names.map(&:to_sym))
= where(:id => [:id]).first_or_create()
return if .update_attributes()
Rails.logger.warn .errors.inspect
end
|