mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
When unassigned accounts in CSV import, always allow new account creation
This commit is contained in:
parent
cd9f20747c
commit
a20809eee3
3 changed files with 19 additions and 6 deletions
|
@ -113,8 +113,12 @@ class Import < ApplicationRecord
|
|||
cleaned? && mappings.all?(&:valid?)
|
||||
end
|
||||
|
||||
def has_unassigned_account?
|
||||
mappings.accounts.where(key: "").any?
|
||||
end
|
||||
|
||||
def requires_account?
|
||||
family.accounts.empty? && mappings.accounts.where(key: "").any?
|
||||
family.accounts.empty? && has_unassigned_account?
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue