From 42870985da06418461c847563fa860c11b4094a1 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 10 Jun 2014 10:04:29 +0100 Subject: Rename XXX comments with TODO: Picks these up in `rake notes` and adds semantic meaning --- app/controllers/admin_request_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers/admin_request_controller.rb') diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index fc291d998..5c45a6e6e 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -199,7 +199,7 @@ class AdminRequestController < AdminController end # Bejeeps, look, sometimes a URL is something that belongs in a controller, jesus. - # XXX hammer this square peg into the round MVC hole + # TODO: hammer this square peg into the round MVC hole post_redirect = PostRedirect.new( :uri => upload_response_url(:url_title => info_request.url_title), :user_id => user.id) @@ -253,7 +253,7 @@ class AdminRequestController < AdminController end info_request_event.described_state = 'waiting_clarification' info_request_event.calculated_state = 'waiting_clarification' - # XXX deliberately don't update described_at so doesn't reenter search? + # TODO: deliberately don't update described_at so doesn't reenter search? info_request_event.save! flash[:notice] = "Old response marked as having been a clarification" -- cgit v1.2.3 From 96e0815eedaa93bceaab176b50271ee8742aba8a Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 18 Aug 2014 16:29:42 +0100 Subject: Use different flash for fully_destroy external InfoRequest Uses a different flash message to avoid trying to fetch a non existent user record --- app/controllers/admin_request_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/controllers/admin_request_controller.rb') diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 5c45a6e6e..8a5f1bd14 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -100,7 +100,8 @@ class AdminRequestController < AdminController @info_request.fully_destroy # expire cached files expire_for_request(@info_request) - flash[:notice] = "Request #{url_title} has been completely destroyed. Email of user who made request: " + user.email + email = user.try(:email) ? user.email : 'This request is external so has no associated user' + flash[:notice] = "Request #{url_title} has been completely destroyed. Email of user who made request: " + email redirect_to admin_request_list_url end -- cgit v1.2.3 From 23a2f7f147ae49f35aa573c2dc68e33c43178471 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 18 Aug 2014 16:31:24 +0100 Subject: Interpolate rather than String#+ https://github.com/bbatsov/ruby-style-guide#concat-strings --- app/controllers/admin_request_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/admin_request_controller.rb') diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 8a5f1bd14..21120e4ad 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -101,7 +101,7 @@ class AdminRequestController < AdminController # expire cached files expire_for_request(@info_request) email = user.try(:email) ? user.email : 'This request is external so has no associated user' - flash[:notice] = "Request #{url_title} has been completely destroyed. Email of user who made request: " + email + flash[:notice] = "Request #{ url_title } has been completely destroyed. Email of user who made request: #{ email }" redirect_to admin_request_list_url end -- cgit v1.2.3