Needs to be number

Stephen Paul Weber created

Change summary

lib/customer_usage.rb | 2 +-
sgx_jmp.rb            | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

Detailed changes

lib/customer_usage.rb 🔗

@@ -38,7 +38,7 @@ class CustomerUsage
 				today.strftime("%Y%m%d")
 			),
 			incr_body(amount, body)
-		]).then { |result| { today: result[1], body: result[2] } }
+		]).then { |result| { today: result[1].to_i, body: result[2].to_i } }
 	end
 
 	def incr_body(amount, body)

sgx_jmp.rb 🔗

@@ -413,7 +413,7 @@ message do |m|
 			TrustLevelRepo.new.find(customer),
 			customer.incr_message_usage(1, m.body)
 		]).then { |(tl, usage)|
-			next if tl.send_message?(usage[:today]) && usage[:body].to_i < 5
+			next if tl.send_message?(usage[:today]) && usage[:body] < 5
 
 			log.warn "OverLimit", m
 			raise OverLimit.new(customer, usage)