xapor 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/xapor/model_integration.rb +10 -0
- data/xapor.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.13
|
@@ -48,6 +48,11 @@ module Xapor::XapianFuIntegration
|
|
48
48
|
end
|
49
49
|
if defined? ActiveRecord && ancestors.includes(ActiveRecord::Base)
|
50
50
|
class_eval("after_save :add_to_index")
|
51
|
+
class_eval("after_destroy :remove_from_index")
|
52
|
+
unless @config.directory_config
|
53
|
+
#in-memory index, needs to be indexed on startup
|
54
|
+
class_eval("all.each {|o| o.add_to_index}")
|
55
|
+
end
|
51
56
|
end
|
52
57
|
end
|
53
58
|
end
|
@@ -60,6 +65,11 @@ module Xapor::XapianFuIntegration
|
|
60
65
|
self.class.xapor_db << doc
|
61
66
|
self.class.xapor_db.flush
|
62
67
|
end
|
68
|
+
|
69
|
+
def remove_from_index
|
70
|
+
self.class.xapor_db.documents.delete(self.id)
|
71
|
+
self.class.xapor_db.flush
|
72
|
+
end
|
63
73
|
end
|
64
74
|
|
65
75
|
if defined? ActiveRecord
|
data/xapor.gemspec
CHANGED