Skip to content

Commit ae50143

Browse files
committed
annotations part2
1 parent 32c0149 commit ae50143

16 files changed

+69
-1
lines changed

app/controllers/accounts_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ class AccountsController < ApplicationController
66
before_action :determine_plan, only: [:create, :update]
77
before_action :ensure_eligibility, only: [:new]
88

9+
# GET /teams/:team_id/account/new(.:format)
910
def new
1011
@account ||= current_user.team.build_account
1112
@plan = params[:public_id]
1213
end
1314

15+
# POST /teams/:team_id/account(.:format)
1416
def create
1517
redirect_to teamname_path(slug: @team.slug) if @plan.free?
1618

@@ -31,6 +33,7 @@ def create
3133
end
3234
end
3335

36+
# PUT /teams/:team_id/account(.:format)
3437
def update
3538
if @account.update_attributes(account_params) && @account.save_with_payment(@plan)
3639
redirect_to new_team_opportunity_path(@team), notice: "You are subscribed to #{@plan.name}." + plan_capability(@plan, @team)
@@ -56,6 +59,7 @@ def webhook
5659
end
5760
end
5861

62+
# POST /teams/:team_id/account/send_invoice(.:format)
5963
def send_invoice
6064
team, period = Team.find(params[:team_id]), 1.month.ago
6165

app/controllers/achievements_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class AchievementsController < ApplicationController
66

77
respond_to :json, only: [:award]
88

9+
# GET /:username/achievements/:id(.:format)
910
def show
1011
show_achievements_params = params.permit(:id, :username)
1112

app/controllers/bans_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class BansController < BaseAdminController
2+
3+
# POST /users/:user_id/bans(.:format)
24
def create
35
ban_params = params.permit(:user_id)
46
user = User.find(ban_params[:user_id])

app/controllers/callbacks/hawt_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class Callbacks::HawtController < ApplicationController
77
protect_from_forgery with: :null_session
88
respond_to :json
99

10+
# POST /callbacks/hawt/feature(.:format)
1011
def feature
1112
logger.ap(params, :debug)
1213

@@ -17,6 +18,7 @@ def feature
1718
end
1819
end
1920

21+
# POST /callbacks/hawt/unfeature(.:format)
2022
def unfeature
2123
unfeature!(hawt_callback_params[:protip_id], hawt_callback_params[:hawt?])
2224

app/controllers/endorsements_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
class EndorsementsController < ApplicationController
22

3+
# GET /users/:user_id/endorsements(.:format)
34
def index
45
flash[:notice] = 'You must be signed in to make an endorsement.'
56
#This is called when someone tries to endorse while unauthenticated
@@ -8,6 +9,7 @@ def index
89
redirect_to(signin_path)
910
end
1011

12+
# POST /users/:user_id/endorsements(.:format)
1113
def create
1214
return head(:forbidden) unless signed_in? && params[:user_id] != current_user.id.to_s
1315
@user = User.find(params[:user_id])
@@ -21,6 +23,8 @@ def create
2123
}
2224
end
2325

26+
# GET /users/:user_id/endorsements/:id(.:format)
27+
# GET /:username/endorsements.json(.:format)
2428
def show #Used by api.coderwall.com
2529
@user = User.find_by_username(params[:username])
2630
return head(:not_found) if @user.nil?

app/controllers/errors_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
class ErrorsController < ApplicationController
2+
3+
# GET|POST|PATCH|DELETE /404(.:format)
24
def not_found
35
render status: :not_found
46
end
57

8+
# GET|POST|PATCH|DELETE /422(.:format)
69
def unacceptable
710
respond_to do |format|
811
format.html { render 'public/422', status: :unprocessable_entity }
@@ -11,6 +14,7 @@ def unacceptable
1114
end
1215
end
1316

17+
# GET|POST|PATCH|DELETE /500(.:format)
1418
def internal_error
1519
respond_to do |format|
1620
format.html { render 'public/500', status: :internal_server_error }

app/controllers/follows_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ class FollowsController < ApplicationController
44

55
helper_method :is_viewing_followers?
66

7+
# GET /users/:user_id/follows(.:format)
8+
# GET /:username/followers(.:format)
9+
# GET /:username/following(.:format)
710
def index
811
@user = User.find_by_username(params[:username])
912
return redirect_to(user_follows_url(username: current_user.username)) unless @user == current_user || current_user.admin?

app/controllers/members_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class MembersController < ApplicationController
22
before_action :set_team
33

4+
# DELETE /teams/:team_id/members/:id(.:format)
45
def destroy
56
self_removal = current_user.id == params[:id]
67
return head(:forbidden) unless signed_in? && (@team.admin?(current_user) || self_removal)

app/controllers/opportunities_controller.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class OpportunitiesController < ApplicationController
66
before_action :verify_payment, only: [:new, :create]
77
before_action :stringify_location, only: [:create, :update]
88

9+
# POST /teams/:team_id/opportunities/:id/apply(.:format)
910
def apply
1011
redirect_to_signup_if_unauthenticated(request.referer, "You must login/signup to apply for an opportunity") do
1112
job = Opportunity.find(params[:id])
@@ -20,14 +21,17 @@ def apply
2021
end
2122
end
2223

24+
# GET /teams/:team_id/opportunities/new(.:format)
2325
def new
2426
team_id = params[:team_id]
2527
@job = Opportunity.new(team_id: team_id)
2628
end
2729

30+
# GET /teams/:team_id/opportunities/:id/edit(.:format)
2831
def edit
2932
end
3033

34+
# POST /teams/:team_id/opportunities(.:format)
3135
def create
3236
opportunity_create_params = params.require(:opportunity).permit(:name, :team_id, :opportunity_type, :description, :tag_list, :location, :link, :salary, :apply, :remote)
3337
@job = Opportunity.new(opportunity_create_params)
@@ -41,6 +45,7 @@ def create
4145
end
4246
end
4347

48+
# PUT /teams/:team_id/opportunities/:id(.:format)
4449
def update
4550
opportunity_update_params = params.require(:opportunity).permit(:id, :name, :team_id, :opportunity_type, :description, :tag_list, :location, :link, :salary, :apply)
4651
respond_to do |format|
@@ -52,16 +57,19 @@ def update
5257
end
5358
end
5459

60+
# GET /teams/:team_id/opportunities/:id/activate(.:format)
5561
def activate
5662
@job.activate!
5763
header_ok
5864
end
5965

66+
# GET /teams/:team_id/opportunities/:id/deactivate(.:format)
6067
def deactivate
6168
@job.deactivate!
6269
header_ok
6370
end
6471

72+
# POST /teams/:team_id/opportunities/:id/visit(.:format)
6573
def visit
6674
unless is_admin?
6775
viewing_user.track_opportunity_view!(@job) if viewing_user

app/controllers/pictures_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class PicturesController < ApplicationController
2+
3+
# POST /users/:user_id/pictures(.:format)
24
def create
35
picture = current_user.create_picture(file: params[:picture])
46
render json: picture

0 commit comments

Comments
 (0)