Actually send parent id to child instance
1 files changed, 8 insertions(+), 2 deletions(-) M lib/customer.rb
M lib/customer.rb => lib/customer.rb +8 -2
@@ 35,10 35,16 @@ class Customer :transactions def self.extract(customer_id, jid, **kwargs) (kwargs[:parent_customer_id] ? ChildCustomer : Customer).new( klass, *keys = if kwargs[:parent_customer_id] [ChildCustomer, :parent_customer_id] else [Customer] end klass.new( customer_id, jid, plan: CustomerPlan.extract(customer_id, kwargs), **kwargs.slice(:balance, :sgx, :tndetails) **kwargs.slice(:balance, :sgx, :tndetails, *keys) ) end