Closed ngoctien1102 closed 9 months ago
Hi! I have the same issue after updating rails to 7 version. Is this issue fixed after all?
Possibly this is related to https://github.com/rails/rails/issues/49457. We should have a fix soon...
converting to hash working fine, but it's a temporary solution, waiting for the fix, thanks @pkuczynski
Settings.length.to_h[:maximum]
Patch in https://github.com/rubyconfig/config/pull/342 doesn't fix it for me.
I am not able to work on a fix, but I will happily approve a PR and make a quick release. Any volunteer?
@pkuczynski hi! I'd like to contribute. First, I need to explore a little bit how the code works and then I can suggest my solution and we can discuss it here
@pkuczynski pull request is ready for review, I decided to fix it right away as it turned out to be an easy one 😸
Merged and published! Thank you @ikael21
When upgrading my project to new version of Ruby and Rails, the settings stored with
minimum
andmaximum
keys are now raising errors:~/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4.2/lib/active_support/core_ext/enumerable.rb:44:in
minimum': wrong number of arguments (given 0, expected 1) (ArgumentError)`Ruby version: 3.1.3 Rails version: 7.0.4.2
How to reproduce:
config/settings.yml
with:rails console
, try access the value withSettings.user_limit.minimum
andSettings.user_limit.maximum
Expect: Should be able to access minimum and maximum with corresponding values of 9 and 99 Reality: Error raises
~/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4.2/lib/active_support/core_ext/enumerable.rb:44:in
minimum': wrong number of arguments (given 0, expected 1) (ArgumentError)`