Skip to content

Commit

Permalink
Workaround buggy version of ruby
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
isimluk committed Jan 20, 2017
1 parent 943a62e commit bb40e8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/chargeback_tier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit bb40e8a

Please sign in to comment.