# == 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::ReleaseEvent < ProjectAction
  def self.build(project, user, version_release)
    project_action = new(project: project, user: user)
    project_action.event_extra = {
      tag_name: version_release.tag_name,
      name: version_release.name,
      body: version_release.body
    }
    project_action.save!
  end
end
