Skip to content

Commit

Permalink
Update rails.rb
Browse files Browse the repository at this point in the history
BigDecimal doesn't have a .new anymore
  • Loading branch information
jacklin10 authored Jul 30, 2022
1 parent 4a2711b commit c476f57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/money/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def money(name, options = {})
self.send(:write_attribute, field_name, nil)
else
val = 0 if val.blank?
val = BigDecimal.new(val.to_s).to_money(precision).round(rounding || precision)
val = BigDecimal(val.to_s).to_money(precision).round(rounding || precision)
self.send(:write_attribute, field_name, val.cents)
end
end
Expand Down

0 comments on commit c476f57

Please sign in to comment.