parallel_minion 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c21b49137a63767cfe4e2099511a16d6c62ec23
4
- data.tar.gz: c3e35379f6faa44e69d5531df99836bd2d4a1068
3
+ metadata.gz: c55aa4fa4b866ca16a9d4f27a089230a06f6c475
4
+ data.tar.gz: 4aba2d86c6cf59bf3fcaedbe3b269010c3e66bea
5
5
  SHA512:
6
- metadata.gz: 0aa5d3339ef72c040c39be80c32a02830f15e3f206c0f24c7d1b7b4acb7ff7d6108abf60c2614cef4d95ff126c40a5deca8ab4a8342cbcca94b1e214eab5cb47
7
- data.tar.gz: 2ea29aaf2d674970bd6040714c783016964c3c3f4f81479e3f778541caadf0690dd71b5f576f9331b8f54ba47c798730fb5b3bd00b3c39251ac148ccdb29fc86
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.dup if defined?(ActiveRecord::Base)
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
- def self.current_scopes
225
- @@scoped_classes.collect {|klass| klass.all.dup}
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
@@ -1,3 +1,3 @@
1
1
  module ParallelMinion #:nodoc
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-17 00:00:00.000000000 Z
11
+ date: 2013-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semantic_logger