Fix for newer ruby

Stephen Paul Weber created

Change summary

.rubocop.yml         | 3 +++
lib/customer_plan.rb | 1 +
2 files changed, 4 insertions(+)

Detailed changes

.rubocop.yml 🔗

@@ -96,6 +96,9 @@ Style/DoubleNegation:
   EnforcedStyle: allowed_in_returns
   Enabled: false
 
+Style/ParallelAssignment:
+  Enabled: false
+
 Style/PerlBackrefs:
   Enabled: false
 

lib/customer_plan.rb 🔗

@@ -53,6 +53,7 @@ class CustomerPlan
 	end
 
 	def initialize(customer_id=nil, **kwargs)
+		kwargs, customer_id = customer_id, nil if customer_id.is_a?(Hash)
 		kwargs[:plan] = kwargs.delete(:plan_name) if kwargs.key?(:plan_name)
 		super(customer_id ? kwargs.merge(customer_id: customer_id) : kwargs)
 	end