xapor 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.12
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{xapor}
8
- s.version = "0.0.12"
8
+ s.version = "0.0.13"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David Workman"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 12
9
- version: 0.0.12
8
+ - 13
9
+ version: 0.0.13
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Workman