mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Account:: namespace simplifications and cleanup (#2110)
* Flatten Holding model * Flatten balance model * Entries domain renames * Fix valuations reference * Fix trades stream * Fix brakeman warnings * Fix tests * Replace existing entryable type references in DB
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
module Account::EntriesHelper
|
||||
module EntriesHelper
|
||||
def entries_by_date(entries, totals: false)
|
||||
transfer_groups = entries.group_by do |entry|
|
||||
# Only check for transfer if it's a transaction
|
||||
next nil unless entry.entryable_type == "Account::Transaction"
|
||||
next nil unless entry.entryable_type == "Transaction"
|
||||
entry.entryable.transfer&.id
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ module Account::EntriesHelper
|
||||
grouped_entries
|
||||
else
|
||||
grouped_entries.reject do |e|
|
||||
e.entryable_type == "Account::Transaction" &&
|
||||
e.entryable_type == "Transaction" &&
|
||||
e.entryable.transfer_as_inflow.present?
|
||||
end
|
||||
end
|
||||
@@ -25,7 +25,7 @@ module Account::EntriesHelper
|
||||
|
||||
next if content.blank?
|
||||
|
||||
render partial: "account/entries/entry_group", locals: { date:, entries: grouped_entries, content:, totals: }
|
||||
render partial: "entries/entry_group", locals: { date:, entries: grouped_entries, content:, totals: }
|
||||
end.compact.join.html_safe
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user