Fixed Data Access Restriction (#636)

Co-authored-by: Harshit Chaudhary <harshit.chaudhary@procol.in>
This commit was merged in pull request #636.
This commit is contained in:
Harshit Chaudhary
2024-04-17 01:28:53 +05:30
committed by GitHub
parent cd8d741fe1
commit 39d57a167e

View File

@@ -71,10 +71,7 @@ class Account < ApplicationRecord
Accountable.by_classification.each do |classification, types|
types.each do |type|
group = grouped_accounts[classification.to_sym].add_child_group(type, currency)
Accountable.from_type(type).includes(:account).each do |accountable|
account = accountable.account
next unless account
self.where(accountable_type: type).each do |account|
value_node = group.add_value_node(
account,
account.balance_money.exchange_to(currency) || Money.new(0, currency),