Skip to content

minimum, maximum keys are conflicted with active_support methods. #329

@ngoctien1102

Description

@ngoctien1102

When upgrading my project to new version of Ruby and Rails, the settings stored with minimum and maximum 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:

  • Initialize new rails project
  • Add gem config, then run bundle
  • Edit config/settings.yml with:
    Screen Shot 2023-02-08 at 22 14 50
  • In rails console, try access the value with Settings.user_limit.minimum and Settings.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)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions