search_and_resque 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ad86e4b35d185b5d25a7396261908351e938021
4
- data.tar.gz: 3f50eb245144bb3a970d116797af9058633a363f
3
+ metadata.gz: 7df05ec8241b807b79297c0162da94d081f5a59e
4
+ data.tar.gz: cd629b3038930463f0518d05a469626ac784d9ca
5
5
  SHA512:
6
- metadata.gz: fb86cffcdd4bd64c86a25d1785077fd82d4b35e04283d4323008b18d3d7960951a1a437a237a4f3a896dfe8c33cc17def5b6be3010b426c7f093f6fdf774f123
7
- data.tar.gz: 8811816945c72859930ae4a043ca0fc510ad3887a43c642894480365182ea4b01ab2bab7ea078b64389a2beda8fa8d6c08c8184a6ded94e82285849926825e9c
6
+ metadata.gz: b9c3b05a1dcff21ce0ef93a4a830bff88210c27873773ed76c789a8c7dc2490e8f93f02393e5b067c3396e9fc6bc39cfe89384dd2fa75bec83eb87ed315caf04
7
+ data.tar.gz: aad5a15f83e7727c7af2f06b3775a6e23d8ca221d9c5af32f9a650ffa547d8dbfd870579a82396b5f28a2ea8a08e6ba43eda2986fccedc6dfecbbee44617b10d
@@ -24,6 +24,10 @@ module SearchAndResque
24
24
  @index_name
25
25
  end
26
26
 
27
+ def self.chewy_index
28
+ Object.const_get(index_name)
29
+ end
30
+
27
31
  module ClassMethods
28
32
  def search_and_resque(type_name, options={})
29
33
  unless included_modules.include?(SearchAndResque::Callbacks)
@@ -4,21 +4,20 @@ module SearchAndResque
4
4
  attr_accessor :queue
5
5
  end
6
6
 
7
- def self.perform(index_name, type_name, action, ids)
8
- index = Chewy::Index.subclasses.find{ |ind| ind.index_name == index_name }
9
- type = index.types.find{ |t| t.type_name == type_name }
7
+ def self.perform(type_name, action, ids)
8
+ type = SearchAndResque.index.types.find{ |t| t.type_name == type_name }
10
9
  type.send(action, ids)
11
10
  end
12
11
 
13
12
  def self.enqueue_update(type_name, ids)
14
13
  unless ids.empty?
15
- Resque.enqueue(self, SearchAndResque.index_name, type_name, :import!, ids)
14
+ Resque.enqueue(self, type_name, :import!, ids)
16
15
  end
17
16
  end
18
17
 
19
18
  def self.enqueue_delete(type_name, ids)
20
19
  unless ids.empty?
21
- Resque.enqueue(self, SearchAndResque.index_name, type_name, :delete!, ids)
20
+ Resque.enqueue(self, type_name, :delete!, ids)
22
21
  end
23
22
  end
24
23
  end
@@ -1,3 +1,3 @@
1
1
  module SearchAndResque
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: search_and_resque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Woo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-11 00:00:00.000000000 Z
11
+ date: 2014-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler