activesearch 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/activesearch/mongoid/model.rb +2 -2
- data/lib/activesearch/version.rb +1 -1
- metadata +1 -1
@@ -17,8 +17,9 @@ module ActiveSearch
|
|
17
17
|
|
18
18
|
def store_fields(original, fields, options)
|
19
19
|
if options && options[:store]
|
20
|
+
self._stored = {}
|
20
21
|
options[:store].each do |f|
|
21
|
-
self._stored[f] = original[f] if original.
|
22
|
+
self._stored[f] = original[f] if original[f].present?
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
@@ -42,7 +43,6 @@ module ActiveSearch
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def self.reindex(original, fields, options)
|
45
|
-
return unless fields.any? { |f| original.send("#{f}_changed?") }
|
46
46
|
doc = find_or_initialize_by(_original_type: original.class.to_s, _original_id: original.id)
|
47
47
|
doc.store_fields(original, fields, options)
|
48
48
|
doc.refresh_keywords(original, fields)
|
data/lib/activesearch/version.rb
CHANGED