Class: GithubHookController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/github_hook_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/github_hook_controller.rb', line 6

def index
  message_logger = GithubHook::MessageLogger.new(logger)
  update_repository(message_logger) if request.post?
  messages = message_logger.messages.map { |log| log[:message] }
  render(:json => messages)

rescue ActiveRecord::RecordNotFound => error
  render_error_as_json(error, 404)

rescue TypeError => error
  render_error_as_json(error, 412)
end

#welcomeObject



19
20
21
# File 'app/controllers/github_hook_controller.rb', line 19

def welcome
  # Render the default layout
end