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

app/controllers/provider_user_lookups_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class ProviderUserLookupsController < ApplicationController
2+
3+
# GET /providers/:provider/:username(.:format)
24
def show
35
service = ProviderUserLookupService.new params[:provider], params[:username]
46
if user = service.lookup_user

app/controllers/sessions_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def new
77
redirect_to destination_url if signed_in?
88
end
99

10+
# GET /signin(.:format)
1011
def signin
1112
#FIXME
1213
return redirect_to destination_url if signed_in?

app/controllers/skills_controller.rb

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

3+
# POST /users/:user_id/skills(.:format)
34
def create
45
@user = (params[:user_id] && User.find(params[:user_id])) || current_user
56
return head(:forbidden) unless current_user == @user
@@ -24,6 +25,7 @@ def create
2425
redirect_to(badge_url(username: @user.username))
2526
end
2627

28+
# DELETE /users/:user_id/skills/:id(.:format)
2729
def destroy
2830
redirect_to_signup_if_unauthenticated do
2931
@skill = current_user.skills.find(params[:id])

app/controllers/teams_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class TeamsController < ApplicationController
55
respond_to :js, :only => [:search, :create, :approve_join, :deny_join]
66
respond_to :json, :only => [:search]
77

8+
# GET /teams(.:format)
89
def index
910
current_user.seen(:teams) if signed_in?
1011
#@featured_teams = Rails.cache.fetch(Team::FEATURED_TEAMS_CACHE_KEY, expires_in: 4.hours) do
@@ -54,10 +55,12 @@ def show
5455
end
5556
end
5657

58+
# GET /teams/new(.:format)
5759
def new
5860
return redirect_to employers_path
5961
end
6062

63+
# POST /teams(.:format)
6164
def create
6265
team_params = params.require(:team).permit(:name, :slug, :show_similar, :join_team)
6366
team_name = team_params.fetch(:name, '')
@@ -97,6 +100,7 @@ def edit
97100
show
98101
end
99102

103+
# PUT /teams/:id(.:format) teams#update
100104
def update
101105
update_params = params.permit(:id, :_id, :job_id, :slug)
102106
update_team_params = params.require(:team).permit!
@@ -149,6 +153,7 @@ def follow
149153
end
150154
end
151155

156+
# GET /employers(.:format)
152157
def upgrade
153158
upgrade_params = params.permit(:discount)
154159

app/controllers/unbans_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
class UnbansController < BaseAdminController
22

3+
# POST /users/:user_id/unbans(.:format)
34
def create
45
ban_params = params.permit(:user_id)
56
user = User.find(ban_params[:user_id])

app/controllers/users_controller.rb

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@ class UsersController < ApplicationController
44

55
layout 'coderwallv2', only: :edit
66

7+
# GET /users/new(.:format)
78
def new
89
return redirect_to(destination_url) if signed_in?
910
return redirect_to(new_session_url) if oauth.blank?
1011

1112
@user = User.for_omniauth(oauth)
1213
end
1314

14-
# /:username
15+
# GET /github/:username(.:format)
16+
# GET /twitter/:username(.:format)
17+
# GET /forrst/:username(.:format)
18+
# GET /dribbble/:username(.:format)
19+
# GET /linkedin/:username(.:format)
20+
# GET /codeplex/:username(.:format)
21+
# GET /bitbucket/:username(.:format)
22+
# GET /stackoverflow/:username(.:format)
23+
# GET /:username(.:format)
24+
# GET /users/:id(.:format)
1525
def show
1626
@user = User.find_by_username!(params[:username])
1727

@@ -49,6 +59,7 @@ def show
4959
end
5060
end
5161

62+
# GET /users(.:format)
5263
def index
5364
if signed_in? && current_user.admin?
5465
return redirect_to(admin_root_url)
@@ -59,6 +70,7 @@ def index
5970
end
6071
end
6172

73+
# POST /users(.:format)
6274
def create
6375
@user = User.for_omniauth(oauth)
6476

@@ -101,6 +113,7 @@ def edit
101113
end
102114
end
103115

116+
# PUT /users/:id(.:format)
104117
def update
105118

106119
user_id = params[:id]
@@ -130,6 +143,7 @@ def update
130143

131144
end
132145

146+
# POST /users/teams_update/:membership_id(.:format)
133147
def teams_update
134148
membership=Teams::Member.find(params['membership_id'])
135149
if membership.update_attributes(teams_member)
@@ -140,6 +154,7 @@ def teams_update
140154
redirect_to(edit_user_url(membership.user))
141155
end
142156

157+
# GET /users/autocomplete(.:format)
143158
def autocomplete
144159
autocomplete_params = params.permit(:query)
145160
respond_to do |f|
@@ -160,6 +175,7 @@ def autocomplete
160175
end
161176
end
162177

178+
# GET /roll-the-dice(.:format)
163179
def randomize
164180
random_user = User.random.first
165181
if random_user
@@ -169,13 +185,15 @@ def randomize
169185
end
170186
end
171187

188+
# POST /users/:id/specialties(.:format)
172189
def specialties
173190
@user = current_user
174191
specialties = params.permit(:specialties)
175192
@user.update_attribute(:specialties, specialties)
176193
redirect_to badge_url(@user.username)
177194
end
178195

196+
# GET /clear/:id/:provider(.:format)
179197
def clear_provider
180198
return head(:forbidden) unless current_user.admin?
181199

@@ -197,6 +215,14 @@ def settings
197215
end
198216
end
199217

218+
# POST /github/unlink(.:format)
219+
# POST /twitter/unlink(.:format)
220+
# POST /forrst/unlink(.:format)
221+
# POST /dribbble/unlink(.:format)
222+
# POST /linkedin/unlink(.:format)
223+
# POST /codeplex/unlink(.:format)
224+
# POST /bitbucket/unlink(.:format)
225+
# POST /stackoverflow/unlink(.:format)
200226
def unlink_provider
201227
return head(:forbidden) unless signed_in?
202228

0 commit comments

Comments
 (0)