Skip to content

Commit

Permalink
Fix rate adjustment when searching for the right interval
Browse files Browse the repository at this point in the history
Interestingly, the math for tiers was broken from day zero. In most
cases however, rate_adjustoment=1, so this came unnoticed.

This makes the new test green again.
  • Loading branch information
isimluk committed Feb 15, 2017
1 parent 9e8094e commit 671628d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/chargeback_rate_detail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def fixed?
def find_rate(value)
fixed_rate = 0.0
variable_rate = 0.0
tier_found = chargeback_tiers.detect { |tier| tier.includes?(value / rate_adjustment) }
tier_found = chargeback_tiers.detect { |tier| tier.includes?(value * rate_adjustment) }
unless tier_found.nil?
fixed_rate = tier_found.fixed_rate
variable_rate = tier_found.variable_rate
Expand Down

0 comments on commit 671628d

Please sign in to comment.