Skip to content

Commit

Permalink
Fix regression(missing extra_data)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Zhogolev committed Sep 14, 2016
1 parent efa2542 commit e59a4c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rails-jquery-autocomplete/autocomplete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def get_object(model_sym)
def json_for_autocomplete(items, method, extra_data=[], extra_methods=[])
items = items.collect do |item|
hash = HashWithIndifferentAccess.new({"id" => item.id.to_s, "label" => item.send(method), "value" => item.send(method)})
extra_data.each do |datum|
hash[datum] = item.send(datum)
end if extra_data
extra_methods.each do |datum|
hash[datum] = item.send(datum)
end if extra_methods
Expand Down

0 comments on commit e59a4c7

Please sign in to comment.