NoMethodError - undefined method `id' for #<Hash
Lyubomyr opened this issue · 2 comments
Lyubomyr commented
I had an issue using Rails 4.0.2, Ruby 2.1.0, rails3-jquery-autocomplete 1.0.13, ActiveRecord, PostgreSQL, right after update to last version of gem:
"NoMethodError - undefined method `id' for #Hash:0x00000005b47120"
when autocomplite method call.
Think it's after your update:
-items.collect! do |item|
+items = items.collect do |item|
For now fix by monkey patch:
def json_for_autocomplete(items, method, extra_data=[])
items = items.to_a.collect do |item|
...
bigtunacan commented
This was fixed on master. You can point to GitHub temporarily if you need to; I will be pushing an updated gem to rubygems by this weekend.
Lyubomyr commented
Good. Thanks.