Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing settings as strings via #[] #82

Closed
waiting-for-dev opened this issue Feb 21, 2020 · 1 comment · Fixed by #83
Closed

Accessing settings as strings via #[] #82

waiting-for-dev opened this issue Feb 21, 2020 · 1 comment · Fixed by #83
Labels
Milestone

Comments

@waiting-for-dev
Copy link
Member

Describe the bug

Before the update to 0.11, a setting could be referenced via a string through config.[]. Now it must be a symbol, otherwise the setting is not found.

I'd like to know if it's desired behavior. If not, I can send a patch myself.

To Reproduce

class A
  extend Dry::Configurable

  setting :foo, :bar
end

A.config[:foo]
# => :bar
A.config["foo"]
# => ArgumentError (+foo+ is not a setting name)

Expected behavior

A.config["foo"]
# => :bar

Your environment

Affects two gems I maintain:

waiting-for-dev/warden-jwt_auth#21
waiting-for-dev/devise-jwt#159

@solnic
Copy link
Member

solnic commented Feb 21, 2020

I can send a patch myself.

Please do. My intention was to maintain public API behavior.

@solnic solnic added this to the 0.11.3 milestone Feb 21, 2020
solnic added a commit that referenced this issue Feb 22, 2020
Store settings as symbol and fetch them from symbol or string

[changelog]

version: 0.11.3
fixed: "Retrieving settings by a string name works again (issue #82) (@waiting-for-dev)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants