forked from Trustie/forgeplus
fix: hash to as_json
This commit is contained in:
parent
63b60a0bac
commit
07b704ec98
|
|
@ -24,7 +24,7 @@ class ProjectActions::ForkEvent < ProjectAction
|
|||
forkee_name: fork_project.identifier,
|
||||
forkee_owner_id: fork_project.owner.id,
|
||||
forkee_owner_login: fork_project.owner.login
|
||||
}
|
||||
}.as_json
|
||||
project_action.save!
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class ProjectActions::IssueCommentEvent < ProjectAction
|
|||
issue_id: issue.id,
|
||||
issue_number: issue.project_issues_index,
|
||||
body: journal.notes
|
||||
}
|
||||
}.as_json
|
||||
project_action.save!
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -18,16 +18,16 @@
|
|||
|
||||
class ProjectActions::IssuesEvent < ProjectAction
|
||||
def self.build(project, user, issue, action)
|
||||
# project_action = new(project: project, user: user)
|
||||
# project_action.event_extra = {
|
||||
# issue_id: issue.id,
|
||||
# issue_number: issue.project_issues_index,
|
||||
# issue_author_id: issue.author_id,
|
||||
# issue_author_login: issue.user.login,
|
||||
# title: issue.subject,
|
||||
# body: issue.description,
|
||||
# action: action
|
||||
# }
|
||||
# project_action.save!
|
||||
project_action = new(project: project, user: user)
|
||||
project_action.event_extra = {
|
||||
issue_id: issue.id,
|
||||
issue_number: issue.project_issues_index,
|
||||
issue_author_id: issue.author_id,
|
||||
issue_author_login: issue.user.login,
|
||||
title: issue.subject,
|
||||
body: issue.description,
|
||||
action: action
|
||||
}.as_json
|
||||
project_action.save!
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class ProjectActions::PullRequestEvent < ProjectAction
|
|||
head_repo_id: pull_request.is_original ? pull_request.fork_project_id : pull_request.project_id,
|
||||
head_repo_name: pull_request.project&.identifier,
|
||||
head_ref: pull_request.head
|
||||
}
|
||||
}.as_json
|
||||
project_action.save!
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class ProjectActions::PullRequestReviewCommentEvent < ProjectAction
|
|||
pull_id: pull_request.id,
|
||||
pull_number: pull_request.gitea_number,
|
||||
body: journal.notes
|
||||
}
|
||||
}.as_json
|
||||
project_action.save!
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class ProjectActions::ReleaseEvent < ProjectAction
|
|||
tag_name: version_release.tag_name,
|
||||
name: version_release.name,
|
||||
body: version_release.body
|
||||
}
|
||||
}.as_json
|
||||
project_action.save!
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue