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 CHANGED
@@ -1 +1 @@
1
- 0.0.10
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{xapor}
8
- s.version = "0.0.10"
8
+ s.version = "0.0.11"
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
- - 10
9
- version: 0.0.10
8
+ - 11
9
+ version: 0.0.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Workman