spec/models/mongoid.rb in activesearch-0.0.13 vs spec/models/mongoid.rb in activesearch-0.0.14
- old
+ new
@@ -9,21 +9,23 @@
field :title, type: String
field :text, type: String
field :junk, type: String
field :special, type: Boolean, default: false
- search_by [:title, :text, store: [:title, :junk]], unless: :special
+ field :scope_id, type: Integer
+ search_by [:title, :text, store: [:title, :junk, :scope_id]], unless: :special
end
class AnotherMongoidModel
include Mongoid::Document
include ActiveSearch::Mongoid
field :title, type: String
+ field :scope_id, type: Integer
search_by :options_for_search
def options_for_search
- [:title, :text, store: [:title, :virtual]]
+ [:title, :text, store: [:title, :virtual, :scope_id]]
end
def virtual
"virtual"
end
\ No newline at end of file