From 7ce2d8b7eb546c311098536de9b0f454eaf043d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 12 Jul 2020 22:53:02 +0200 Subject: [PATCH] Remove unused methods One method was calling `reason_for_not_being_ballotable_by` passing just one parameter instead of two. The other method was calling the method `amount_spent`, which does not exist in the Budget class. So both methods would make the application crash if they were called. Luckily, they aren't, so the application doesn't crash. --- app/models/budget.rb | 4 ---- app/models/budget/investment.rb | 4 ---- 2 files changed, 8 deletions(-) diff --git a/app/models/budget.rb b/app/models/budget.rb index 26489419c..8d2a6ef57 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -163,10 +163,6 @@ class Budget < ApplicationRecord formatted_amount(heading_price(heading)) end - def formatted_heading_amount_spent(heading) - formatted_amount(amount_spent(heading)) - end - def investments_orders case phase when "accepting", "reviewing" diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index b11af9e25..61d31b625 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -301,10 +301,6 @@ class Budget user.headings_voted_within_group(group).where(id: heading.id).exists? end - def ballotable_by?(user) - reason_for_not_being_ballotable_by(user).blank? - end - def enough_money?(ballot) available_money = ballot.amount_available(heading) price.to_i <= available_money