From 39d57a167eb2a6e53d3e614071ae5efae9610cec Mon Sep 17 00:00:00 2001 From: Harshit Chaudhary <55315065+Harry-kp@users.noreply.github.com> Date: Wed, 17 Apr 2024 01:28:53 +0530 Subject: [PATCH] Fixed Data Access Restriction (#636) Co-authored-by: Harshit Chaudhary --- app/models/account.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/models/account.rb b/app/models/account.rb index b1d6aec1..dc0cb30a 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -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),