I have a rails initializer that sets the limit on Big Decimal
BigDecimal.limit(20)
This is executed and seems to set the limit properly.
But when a web request comes in (I am using Puma), the limit does not appear to be set on the thread that handles the request. The limit is set to 0 which is the default.
Is there somewhere else I should be setting the limit?
If you want to reproduce:
create a brand new rails app and add an initializer that sets limit
BigDecimal.limit(20)
puts "*** Set #{BigDecimal.limit}"
in your application controller add
before_action :check_big_decimal
def check_big_decimal
puts "***request #{BigDecimal.limit}"
end
start your server, refresh page and make a request
You should see it set to 20 but then it is back to 0 when the request comes in.