From a8e1afc30a1f843943bb29e7385b8611ea3c29f4 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 19 Apr 2017 09:37:42 -0400 Subject: Simplify render in controllers (#2144) --- app/controllers/api/v1/accounts_controller.rb | 22 +++++++++++----------- app/controllers/api/v1/follows_controller.rb | 2 +- app/controllers/api/v1/statuses_controller.rb | 14 +++++++------- app/controllers/api/v1/timelines_controller.rb | 6 +++--- 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'app/controllers/api/v1') diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb index 2c44e36a7..5724dbaea 100644 --- a/app/controllers/api/v1/accounts_controller.rb +++ b/app/controllers/api/v1/accounts_controller.rb @@ -13,13 +13,13 @@ class Api::V1::AccountsController < ApiController def verify_credentials @account = current_user.account - render action: :show + render :show end def update_credentials current_account.update!(account_params) @account = current_account - render action: :show + render :show end def following @@ -32,7 +32,7 @@ class Api::V1::AccountsController < ApiController set_pagination_headers(next_path, prev_path) - render action: :index + render :index end def followers @@ -45,7 +45,7 @@ class Api::V1::AccountsController < ApiController set_pagination_headers(next_path, prev_path) - render action: :index + render :index end def statuses @@ -65,7 +65,7 @@ class Api::V1::AccountsController < ApiController def follow FollowService.new.call(current_user.account, @account.acct) set_relationship - render action: :relationship + render :relationship end def block @@ -77,31 +77,31 @@ class Api::V1::AccountsController < ApiController @requested = { @account.id => false } @muting = { @account.id => current_user.account.muting?(@account.id) } - render action: :relationship + render :relationship end def mute MuteService.new.call(current_user.account, @account) set_relationship - render action: :relationship + render :relationship end def unfollow UnfollowService.new.call(current_user.account, @account) set_relationship - render action: :relationship + render :relationship end def unblock UnblockService.new.call(current_user.account, @account) set_relationship - render action: :relationship + render :relationship end def unmute UnmuteService.new.call(current_user.account, @account) set_relationship - render action: :relationship + render :relationship end def relationships @@ -118,7 +118,7 @@ class Api::V1::AccountsController < ApiController def search @accounts = AccountSearchService.new.call(params[:q], limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:resolve] == 'true', current_account) - render action: :index + render :index end private diff --git a/app/controllers/api/v1/follows_controller.rb b/app/controllers/api/v1/follows_controller.rb index 7c0f44f03..67d823398 100644 --- a/app/controllers/api/v1/follows_controller.rb +++ b/app/controllers/api/v1/follows_controller.rb @@ -10,7 +10,7 @@ class Api::V1::FollowsController < ApiController raise ActiveRecord::RecordNotFound if follow_params[:uri].blank? @account = FollowService.new.call(current_user.account, target_uri).try(:target_account) - render action: :show + render :show end private diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index e88f9cc41..5a2e18cc0 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -40,7 +40,7 @@ class Api::V1::StatusesController < ApiController set_pagination_headers(next_path, prev_path) - render action: :accounts + render :accounts end def favourited_by @@ -53,7 +53,7 @@ class Api::V1::StatusesController < ApiController set_pagination_headers(next_path, prev_path) - render action: :accounts + render :accounts end def create @@ -62,7 +62,7 @@ class Api::V1::StatusesController < ApiController spoiler_text: status_params[:spoiler_text], visibility: status_params[:visibility], application: doorkeeper_token.application) - render action: :show + render :show end def destroy @@ -73,7 +73,7 @@ class Api::V1::StatusesController < ApiController def reblog @status = ReblogService.new.call(current_user.account, Status.find(params[:id])) - render action: :show + render :show end def unreblog @@ -83,12 +83,12 @@ class Api::V1::StatusesController < ApiController RemovalWorker.perform_async(reblog.id) - render action: :show + render :show end def favourite @status = FavouriteService.new.call(current_user.account, Status.find(params[:id])).status.reload - render action: :show + render :show end def unfavourite @@ -97,7 +97,7 @@ class Api::V1::StatusesController < ApiController UnfavouriteWorker.perform_async(current_user.account_id, @status.id) - render action: :show + render :show end private diff --git a/app/controllers/api/v1/timelines_controller.rb b/app/controllers/api/v1/timelines_controller.rb index e55e7d718..27dc3d0ef 100644 --- a/app/controllers/api/v1/timelines_controller.rb +++ b/app/controllers/api/v1/timelines_controller.rb @@ -17,7 +17,7 @@ class Api::V1::TimelinesController < ApiController set_pagination_headers(next_path, prev_path) - render action: :index + render :index end def public @@ -31,7 +31,7 @@ class Api::V1::TimelinesController < ApiController set_pagination_headers(next_path, prev_path) - render action: :index + render :index end def tag @@ -46,7 +46,7 @@ class Api::V1::TimelinesController < ApiController set_pagination_headers(next_path, prev_path) - render action: :index + render :index end private -- cgit