From ccfb6ae26ea3260f5f7bf18761352f96cb0caf7b Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Mon, 8 Mar 2021 10:44:02 +0100 Subject: [PATCH] Fix Money deprecation warning with :rounding_mode This removes the deprecation warning: ``` [WARNING] The default rounding mode will change from `ROUND_HALF_EVEN` to `ROUND_HALF_UP` in the next major release. Set it explicitly using `Money.rounding_mode=` to avoid potential problems. ``` by specifying the default rounding mode at boot time so that it's only set once for the whole app. See https://github.com/RubyMoney/money#rounding for details. --- config/initializers/money.rb | 1 + 1 file changed, 1 insertion(+) create mode 100644 config/initializers/money.rb diff --git a/config/initializers/money.rb b/config/initializers/money.rb new file mode 100644 index 0000000000..4f9d8847f1 --- /dev/null +++ b/config/initializers/money.rb @@ -0,0 +1 @@ +Money.rounding_mode = BigDecimal::ROUND_HALF_EVEN