Skip to content

Commit b23c3d5

Browse files
alouanemedmdeiters
authored andcommitted
Add annotations to actions [ci skip]
1 parent 75ed6d8 commit b23c3d5

25 files changed

+151
-7
lines changed

app/controllers/accounts_controller.rb

Lines changed: 5 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)
@@ -40,6 +43,7 @@ def update
4043
end
4144
end
4245

46+
# GET /webhooks/stripe(.:format)
4347
def webhook
4448
data = JSON.parse request.body.read
4549
if data[:type] == "invoice.payment_succeeded"
@@ -55,6 +59,7 @@ def webhook
5559
end
5660
end
5761

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

app/controllers/achievements_controller.rb

Lines changed: 2 additions & 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

@@ -14,6 +15,7 @@ def show
1415
redirect_to(destination_url) if @badge && @user.username.downcase != show_achievements_params[:username].downcase
1516
end
1617

18+
# POST /award(.:format)
1719
def award
1820

1921
award_params = params.permit(:badge, :twitter, :linkedin, :github, :date)

app/controllers/alerts_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class AlertsController < ApplicationController
77
GA_VISITORS_ALERT_INTERVAL = 30.minutes
88
TRACTION_ALERT_INTERVAL = 30.minutes
99

10+
# GET /alerts(.:format)
1011
def create
1112
case @alert[:type].to_sym
1213
when :traction
@@ -18,6 +19,7 @@ def create
1819
head(:ok)
1920
end
2021

22+
#GET /alerts(.:format)
2123
def index
2224
@alerts = []
2325
[:traction, :google_analytics].each do |type|

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/comments_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class CommentsController < ApplicationController
77
before_action :lookup_protip, only: [:create]
88
before_action :require_moderator!, only: [:mark_as_spam]
99

10+
# POST /p/:protip_id/comments(.:format)
1011
def create
1112
redirect_to_signup_if_unauthenticated(request.referer + "?" + (comment_params.try(:to_query) || ""), "You must signin/signup to add a comment") do
1213
@comment = @protip.comments.build(comment_params)
@@ -26,6 +27,7 @@ def create
2627
end
2728
end
2829

30+
# PUT /p/:protip_id/comments/:id(.:format)
2931
def update
3032
respond_to do |format|
3133
if @comment.update_attributes(comment_params)
@@ -38,6 +40,7 @@ def update
3840
end
3941
end
4042

43+
# DELETE /p/:protip_id/comments/:id(.:format)
4144
def destroy
4245
return head(:forbidden) if @comment.nil?
4346
@comment.destroy
@@ -47,6 +50,7 @@ def destroy
4750
end
4851
end
4952

53+
# POST /p/:protip_id/comments/:id/like(.:format)
5054
def like
5155
redirect_to_signup_if_unauthenticated(request.referer, "You must signin/signup to like a comment") do
5256
@comment.like_by(current_user)
@@ -57,6 +61,7 @@ def like
5761
end
5862
end
5963

64+
# POST /p/:protip_id/comments/:id/mark_as_spam(.:format)
6065
def mark_as_spam
6166
@comment.mark_as_spam
6267
respond_to do |format|

app/controllers/emails_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
class EmailsController < ApplicationController
2+
3+
# GET /unsubscribe(.:format)
24
def unsubscribe
35
Rails.logger.info("Mailgun Unsubscribe: #{params.inspect}")
46
if mailgun?(ENV['MAILGUN_API_KEY'], params['token'], params['timestamp'], params['signature'])
@@ -17,6 +19,7 @@ def unsubscribe
1719
return head(200)
1820
end
1921

22+
# GET /delivered(.:format)
2023
def delivered
2124
Rails.logger.info("Mailgun Delivered: #{params.inspect}")
2225
if mailgun?(ENV['MAILGUN_API_KEY'], params['token'], params['timestamp'], params['signature'])

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: 4 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?
@@ -16,6 +19,7 @@ def index
1619
@network = @network.order('score_cache DESC').page(params[:page]).per(50)
1720
end
1821

22+
# POST /users/:username/follow(.:format)
1923
def create
2024
apply_cache_buster
2125

0 commit comments

Comments
 (0)