From bb40e8a60de8ee1d2ea720b0220bd39949c1f996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Luka=C5=A1=C3=ADk?= Date: Fri, 6 Jan 2017 11:25:41 +0100 Subject: [PATCH] Workaround buggy version of ruby Certain version of ruby (before 2.3.3) have problems with BigDecimal.new(1) <= Float::INFINITY or Float::INFINITY >= BigDecimal.new(1) Forcing BigDecimal to float in this case will not hurt. --- app/models/chargeback_tier.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/chargeback_tier.rb b/app/models/chargeback_tier.rb index 9b13b6e8341..0b128939a74 100644 --- a/app/models/chargeback_tier.rb +++ b/app/models/chargeback_tier.rb @@ -18,7 +18,7 @@ def self.to_float(s) end def includes?(value) - starts_with_zero? && value.zero? || value > start && value <= finish + starts_with_zero? && value.zero? || value > start && value.to_f <= finish end def starts_with_zero?