From 45ae1928914e89fa6886110b5026b7e8b2d80f27 Mon Sep 17 00:00:00 2001 From: viehlieb Date: Tue, 14 Feb 2023 12:25:41 +0100 Subject: [PATCH] move BigDecimal.new to BigDecimal() --- app/models/group_order.rb | 4 ++-- config/initializers/extensions.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/group_order.rb b/app/models/group_order.rb index c789ef4e..f3153c44 100644 --- a/app/models/group_order.rb +++ b/app/models/group_order.rb @@ -32,8 +32,8 @@ class GroupOrder < ApplicationRecord # Generate some data for the javascript methods in ordering view def load_data data = {} - data[:account_balance] = ordergroup.nil? ? BigDecimal.new('+Infinity') : ordergroup.account_balance - data[:available_funds] = ordergroup.nil? ? BigDecimal.new('+Infinity') : ordergroup.get_available_funds(self) + data[:account_balance] = ordergroup.nil? ? BigDecimal('+Infinity') : ordergroup.account_balance + data[:available_funds] = ordergroup.nil? ? BigDecimal('+Infinity') : ordergroup.get_available_funds(self) # load prices and other stuff.... data[:order_articles] = {} diff --git a/config/initializers/extensions.rb b/config/initializers/extensions.rb index 799f52e6..68c7c8f4 100644 --- a/config/initializers/extensions.rb +++ b/config/initializers/extensions.rb @@ -3,7 +3,7 @@ class String # remove comma from decimal inputs def self.delocalized_decimal(string) if !string.blank? and string.is_a?(String) - BigDecimal.new(string.sub(',', '.')) + BigDecimal(string.sub(',', '.')) else string end