mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 14:42:33 -05:00
adjust email configs loading
This commit is contained in:
1 parent
3575a25935
commit
0698aad8e1
2 files changed
+12
-4
No files matched your search
@@ -17,7 +17,15 @@ module AccountConfigs
|
||||
module_function
|
||||
|
||||
def find_or_initialize_for_key(account, key)
|
||||
account.account_configs.find_by(key:) ||
|
||||
find_for_account(account, key) ||
|
||||
account.account_configs.new(key:, value: AccountConfig::DEFAULT_VALUES[key])
|
||||
end
|
||||
|
||||
def find_for_account(account, key)
|
||||
configs = account.account_configs.find_by(key:)
|
||||
|
||||
configs ||= Account.order(:id).first.account_configs.find_by(key:) unless Docuseal.multitenant?
|
||||
|
||||
configs
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user