replaces uniq with distinct
Uniq is deprecated
This commit is contained in:
committed by
Julian Herrero
parent
935b41154f
commit
596ff77ec1
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user