Skip to content

Commit

Permalink
Merge pull request risuiowa#2 from juanpedrojose/fix-regression
Browse files Browse the repository at this point in the history
Fix regression(missing extra_data)
  • Loading branch information
juanpedrojose authored Sep 14, 2016
2 parents efa2542 + e59a4c7 commit f375e5b
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 f375e5b

Please sign in to comment.