thinkingtank 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,7 @@ class << ActiveRecord::Base
15
15
  @thinkingtank_builder = ThinkingTank::Builder.new self, &block
16
16
  @indexable = true
17
17
  after_save :update_index
18
+ before_destroy :delete_from_index
18
19
  end
19
20
 
20
21
  def is_indexable?
@@ -69,6 +69,12 @@ module ThinkingTank
69
69
  data[:__type] = self.class.name
70
70
  it.document(docid).add(data)
71
71
  end
72
+
73
+ def delete_from_index
74
+ it = ThinkingTank::Configuration.instance.client
75
+ docid = self.class.name + ' ' + self.id.to_s
76
+ it.document(docid).delete()
77
+ end
72
78
  end
73
79
 
74
80
  end
metadata CHANGED
@@ -1,89 +1,65 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: thinkingtank
3
- version: !ruby/object:Gem::Version
4
- hash: 15
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.9
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 8
10
- version: 0.0.8
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Flaptor
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-02-18 00:00:00 -08:00
12
+ date: 2011-03-09 00:00:00.000000000 -03:00
19
13
  default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: indextank
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &73693050 !ruby/object:Gem::Requirement
25
18
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 25
30
- segments:
31
- - 1
32
- - 0
33
- - 7
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
34
22
  version: 1.0.7
35
23
  type: :runtime
36
- version_requirements: *id001
37
- description: |-
38
- ActiveRecord extension that allows to define models that should be indexed in an existing IndexTank index.
39
- It supports a very similar syntax to ThinkingSphinx allowing to easily port an existing project.
24
+ prerelease: false
25
+ version_requirements: *73693050
26
+ description: ! "ActiveRecord extension that allows to define models that should be
27
+ indexed in an existing IndexTank index.\n It supports a very similar syntax to
28
+ ThinkingSphinx allowing to easily port an existing project."
40
29
  email: indextank@flaptor.com
41
30
  executables: []
42
-
43
31
  extensions: []
44
-
45
32
  extra_rdoc_files: []
46
-
47
- files:
33
+ files:
48
34
  - lib/thinkingtank.rb
35
+ - lib/thinkingtank/railtie.rb
49
36
  - lib/thinkingtank/activerecord_extensions.rb
50
37
  - lib/thinkingtank/init.rb
51
38
  - lib/thinkingtank/tasks.rb
52
- - lib/thinkingtank/railtie.rb
53
39
  - README.rdoc
54
40
  has_rdoc: true
55
41
  homepage: http://indextank.com/
56
42
  licenses: []
57
-
58
43
  post_install_message:
59
44
  rdoc_options: []
60
-
61
- require_paths:
45
+ require_paths:
62
46
  - lib
63
- required_ruby_version: !ruby/object:Gem::Requirement
47
+ required_ruby_version: !ruby/object:Gem::Requirement
64
48
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- hash: 3
69
- segments:
70
- - 0
71
- version: "0"
72
- required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
54
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 3
78
- segments:
79
- - 0
80
- version: "0"
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
81
59
  requirements: []
82
-
83
60
  rubyforge_project:
84
- rubygems_version: 1.4.1
61
+ rubygems_version: 1.5.2
85
62
  signing_key:
86
63
  specification_version: 3
87
64
  summary: Thinking-Sphinx-like Indextank plugin.
88
65
  test_files: []
89
-