From f8e9566699e5929e04a1b25add2b2f646d1ee6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 10 Jan 2019 15:20:26 +0100 Subject: [PATCH] Simplify return statement Just the way is usually done in the rest of the code. --- app/models/budget/investment.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index c7357ee52..30203bd04 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -145,9 +145,10 @@ class Budget if allowed_sort_option.present? direction = params[:direction] == "desc" ? "desc" : "asc" - return order("#{allowed_sort_option} #{direction}") + order("#{allowed_sort_option} #{direction}") + else + order(cached_votes_up: :desc).order(id: :desc) end - order(cached_votes_up: :desc).order(id: :desc) end def self.limit_results(budget, params, results)