# == Schema Information
#
# Table name: project_actions
#
#  id          :integer          not null, primary key
#  project_id  :integer
#  type        :string(255)
#  user_id     :integer
#  event_extra :text(65535)
#  created_at  :datetime         not null
#  updated_at  :datetime         not null
#
# Indexes
#
#  index_project_actions_on_project_id  (project_id)
#


class ProjectActions::PullRequestReviewCommentEvent < ProjectAction
  def self.build(project, user, pull_request, journal)
    project_action = new(project: project, user: user)
    project_action.event_extra = {
      pull_id: pull_request.id,
      pull_number: pull_request.gitea_number,
      body: journal.notes
    }
    project_action.save!
  end
end
