replaces uniq with distinct

Uniq is deprecated
This commit is contained in:
alejandro
2017-04-04 21:57:09 +02:00
committed by Julian Herrero
parent 935b41154f
commit 596ff77ec1

View File

@@ -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?