xapor 0.0.10 → 0.0.11
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 +4 -3
- data/xapor.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.11
|
@@ -1,6 +1,9 @@
|
|
1
1
|
module Xapor::ModelIntegration
|
2
2
|
def self.included(base)
|
3
3
|
base.send(:include, Xapor::XapianFuIntegration)
|
4
|
+
if defined?(ActiveRecord) && base.is_a?(ActiveRecord::Base)
|
5
|
+
base.after_save :add_to_index
|
6
|
+
end
|
4
7
|
end
|
5
8
|
end
|
6
9
|
|
@@ -21,6 +24,7 @@ module Xapor::XapianFuIntegration
|
|
21
24
|
|
22
25
|
def reset_index
|
23
26
|
if @db
|
27
|
+
@db.flush
|
24
28
|
@db.ro.close
|
25
29
|
@db.rw.close
|
26
30
|
end
|
@@ -38,9 +42,6 @@ module Xapor::XapianFuIntegration
|
|
38
42
|
@db ||= XapianDb.new(@config.xapian_fu_db.merge(:create => true))
|
39
43
|
end
|
40
44
|
end
|
41
|
-
if defined?(ActiveRecord) && self.is_a?(ActiveRecord::Base)
|
42
|
-
self.send(:after_save, :add_to_index)
|
43
|
-
end
|
44
45
|
@config = Xapor::Config.new
|
45
46
|
if block_given?
|
46
47
|
yield @config
|
data/xapor.gemspec
CHANGED