parallel_minion 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parallel_minion/minion.rb +9 -3
- data/lib/parallel_minion/version.rb +1 -1
- data/test/test_db.sqlite3 +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c55aa4fa4b866ca16a9d4f27a089230a06f6c475
|
4
|
+
data.tar.gz: 4aba2d86c6cf59bf3fcaedbe3b269010c3e66bea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c2e8a7b360c79f064a07b86b6a484f0ce2553c1fa0fb8582fff91b5c430d98c33e9dd043387b6d28d3969e3cc79ee1aaed7b18d1b2900b16a79f4912dd43b85
|
7
|
+
data.tar.gz: b7b9f4d9a1d62005d6139f98384ff1278af4677ed7ebee32d0e004eea7eaf196195f5850a279856d75e6288ca4568f5d69eca5ffa67e626f01578552af9bf3a9
|
@@ -140,7 +140,7 @@ module ParallelMinion
|
|
140
140
|
tags = (logger.tags || []).dup
|
141
141
|
|
142
142
|
# Copy current scopes for new thread. Only applicable for AR models
|
143
|
-
scopes = self.class.current_scopes
|
143
|
+
scopes = self.class.current_scopes if defined?(ActiveRecord::Base)
|
144
144
|
|
145
145
|
@thread = Thread.new(*args) do
|
146
146
|
# Copy logging tags from parent thread
|
@@ -221,8 +221,14 @@ module ParallelMinion
|
|
221
221
|
|
222
222
|
# Returns the current scopes for each of the models for which scopes will be
|
223
223
|
# copied to the Minions
|
224
|
-
|
225
|
-
|
224
|
+
if ActiveRecord::VERSION::MAJOR >= 4
|
225
|
+
def self.current_scopes
|
226
|
+
@@scoped_classes.collect {|klass| klass.all}
|
227
|
+
end
|
228
|
+
else
|
229
|
+
def self.current_scopes
|
230
|
+
@@scoped_classes.collect {|klass| klass.scoped}
|
231
|
+
end
|
226
232
|
end
|
227
233
|
|
228
234
|
protected
|
data/test/test_db.sqlite3
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_minion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic_logger
|