-
Notifications
You must be signed in to change notification settings - Fork 268
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
undefined method `to_str' for 🆔Symbol (NoMethodError) in 2.8.2 #498
Comments
Obviously it's due to passing a hash with symbol keys instead of string keys. Just using string keys works, in case other folks run into this and need a work around. require 'addressable'
uri = Addressable::Template.new("https://example/some/api/{?query*}")
uri.expand({'query' => { 'id' => 'abc123' }}) |
@jarthod mind taking a look? I guess the template tests does not use symbols? |
I was also able to reproduce with integers as values, so I think it affects keys and values, just FYI. require 'addressable'
uri = Addressable::Template.new("https://example/some/api/{?query*}")
uri.expand({'query' => { 'id' => 1 }}) |
Looks like addressable/lib/addressable/idna/pure.rb Lines 115 to 117 in ab4bc46
addressable/lib/addressable/idna/native.rb Lines 32 to 34 in ab4bc46
|
I can submit a patch if here you like, though given it's worked for the past 11 years, I'm not sure what unintended side affects it may cause. Someone with more intimate knowledge of the callers may know more? addressable/lib/addressable/template.rb Line 900 in bcaf766
|
I am having a look, I saw specs checking both symbols, string, and integers so I thought this was covered but apparently they were only testing this at the first level, and it turns out there's a special treatment at this level, so I'll add a couple more specs testing this at the second level and provide a patch. From what I can see putting back a Edit: Fix merged in PR #499, sorry for the regression 🙇 |
@dentarg just want to know when the 2.8.3 tag will be cut? thanks |
2.8.3 is out now |
Hi, I'm getting this error when I've updated to
2.8.2
from2.8.1
. Here's a very simple test case inirb
that I've confirmed works in2.8.1
.Here's a simple snippet that you may be able to just copy paste easier.
The text was updated successfully, but these errors were encountered: