How Do I Scope Enums in Rails Using Sunspot?
问题 I am trying to use Sunspot (Rails Solr gem) to scope results using an enum I have declared in my model. The relevant portion of my model looks like this: searchable do text :tag_list boolean :approved integer :perspective time :created_at end enum perspective: [ :not_applicable, :front, :side_front, :side, :side_back, :back, :above, :below ] My search block in my controller looks like this: def index //skip scoping if perspective is nil params[:perspective] ||= [] @search = Upload.search do