Slide 49
Slide 49 text
class User < ApplicationRecord
def handle_github_event(event)
case event
in type: "issue", action: "opened",
issue: {user: {login:}, title:, body:}
issues.create!(title:, body:)
in type: "pull_request", action: "opened",
pull_request: {
user: {login:}, base: {label:}, title:, body:
}
pull_requests.create!(title:, body:, branch:)
end
end
end
43