Add billing_subscription to nonprofit by default
This commit is contained in:
parent
846f7aafae
commit
436efb7c5f
1 changed files with 2 additions and 2 deletions
|
@ -131,6 +131,7 @@ class Nonprofit < ApplicationRecord
|
||||||
before_validation(on: :create) do
|
before_validation(on: :create) do
|
||||||
set_slugs
|
set_slugs
|
||||||
set_user
|
set_user
|
||||||
|
add_billing_subscription
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -253,9 +254,8 @@ private
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_billing_subscription
|
def add_billing_subscription
|
||||||
billing_plan = BillingPlan.find(Houdini.default_bp.id)
|
billing_plan = BillingPlan.find(Houdini.default_bp)
|
||||||
b_sub = build_billing_subscription(billing_plan: billing_plan, status: 'active')
|
b_sub = build_billing_subscription(billing_plan: billing_plan, status: 'active')
|
||||||
b_sub.save!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_registerable_as_admin
|
def user_registerable_as_admin
|
||||||
|
|
Loading…
Reference in a new issue