From 596ff77ec1da4e113353685f4fb0afd0bc2e80b4 Mon Sep 17 00:00:00 2001 From: alejandro Date: Tue, 4 Apr 2017 21:57:09 +0200 Subject: [PATCH] replaces uniq with distinct Uniq is deprecated --- app/models/budget/ballot.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/budget/ballot.rb b/app/models/budget/ballot.rb index b53e8b8e6..27b0d9100 100644 --- a/app/models/budget/ballot.rb +++ b/app/models/budget/ballot.rb @@ -6,8 +6,8 @@ class Budget has_many :lines, dependent: :destroy has_many :investments, through: :lines - has_many :groups, -> { uniq }, through: :lines - has_many :headings, -> { uniq }, through: :groups + has_many :groups, -> { distinct }, through: :lines + has_many :headings, -> { distinct }, through: :groups def add_investment(investment) lines.create(investment: investment).persisted?