Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/controllers/api/bounties_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Api
class BountiesController < ApplicationController

respond_to :json

def index
respond_with do |format|
format.json { render json: Bounty.unclaimed.order(:created_at).decorate }
end
end

end
end
13 changes: 13 additions & 0 deletions app/controllers/api/leaderboard_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Api
class LeaderboardController < ApplicationController

respond_to :json

def index
respond_with do |format|
format.json { render json: Queries::RunningLeaderboard.new.query.decorate }
end
end

end
end
2 changes: 1 addition & 1 deletion app/decorators/bounty_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ def created_at
private

def better_time time_field
object.public_send(time_field).strftime("%m/%d/%y %H:%M")
object.public_send(time_field).strftime("%m/%d/%y %H:%M") if object.send(time_field)
end
end
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
end

resources :events, only: [ :create ]
resources :leaderboard, only: [ :index ]
resources :bounties, only: [ :index ]

namespace :adapters do
resources :github, only: [ :create ]
Expand Down