Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'aspgems/master'

  • Loading branch information...
commit d4c48fa3f888e55cf694b094485de01108331fdf 2 parents 071990b + eebcc72
@kristianmandrup authored
View
3  lib/rails3-jquery-autocomplete/autocomplete.rb
@@ -51,7 +51,8 @@ def autocomplete(object, method, options = {})
if term && !term.blank?
#allow specifying fully qualified class name for model object
class_name = options[:class_name] || object
- items = get_autocomplete_items(:model => get_object(class_name), \
+ model = options[:scoped_model] ? eval(options[:scoped_model]) : get_object(class_name)
+ items = get_autocomplete_items(:model => model, \
:options => options, :term => term, :method => method)
else
items = {}
View
2  lib/rails3-jquery-autocomplete/orm/active_record.rb
@@ -21,7 +21,7 @@ def get_autocomplete_items(parameters)
items = model.scoped
- scopes.each { |scope| items = items.send(scope) } unless scopes.empty?
+ scopes.each { |scope| items = items.send(*Array(scope)) } unless scopes.empty?
items = items.select(get_autocomplete_select_clause(model, method, options)) unless options[:full_model]
items = items.where(get_autocomplete_where_clause(model, term, method, options)).
Please sign in to comment.
Something went wrong with that request. Please try again.