Can't get scopes to work ?
NuggyBuggy opened this issue · 1 comments
I'm trying to customize a query via named scopes.
I have:
class Principal < CrrRecord
scope :has_abc, where("name ='abc'")
end
class AutocompleterController < ApplicationController
autocomplete :principal, :name, :scopes => [:has_abc]
end
Autocomplete works, but the returned list does not seem to apply the scope, that is, I get the full set of results whether or not the condition in the scope is met or not.
I've seen other posts claiming that users could not get scopes to work, but I do not want to override get_autocomplete_items.
What am I doing wrong ?
p.s. thanks for the great gem !
Mea Culpa - I was running a much earlier version of the gem... updating to the newest gem fixes my problem....
Thanks again for the great gem.