mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 21:45:23 +02:00
Handle super admins for billing emails
This commit is contained in:
parent
5da4bb6dc3
commit
c26a7dd2dd
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ module Family::Subscribeable
|
||||||
end
|
end
|
||||||
|
|
||||||
def billing_email
|
def billing_email
|
||||||
primary_admin = users.admin.order(:created_at).first
|
primary_admin = users.admin.order(:created_at).first || users.super_admin.order(:created_at).first
|
||||||
|
|
||||||
unless primary_admin.present?
|
unless primary_admin.present?
|
||||||
raise "No primary admin found for family #{id}. This is an invalid data state and should never occur."
|
raise "No primary admin found for family #{id}. This is an invalid data state and should never occur."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue