resque-serial 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDZkMjIyMDExNTFhZTU4NWU2YTQ5NTM4Y2FiNGQ1NjJjOTliNTg2Mw==
4
+ NWNkMTkyMGFkODliMDZkN2M5MTA4YzMzZDE0ZjZkNDc3ZDAxNjRkNA==
5
5
  data.tar.gz: !binary |-
6
- NTI4NDJlZDk2YWRmMmEyZjVjYmY1MmNiYjUxYjA4NmEzYjMyNzU4ZQ==
6
+ NjEwOGU2NzUyNzIzY2I1ZDU3MjIwYWU5OWRkYTRhOWJkOTU5ZjNmZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Y2I4ZGE3ZWZhZTRiNDQ5NGU5ODAyNmQ4YjRhMjFkZDUyMmRkZGM1ZDgxNTNm
10
- MzcyZjU0MGQzMDUwMDJmY2IyY2MwNWNkNWNkMzVlZTljM2NmNTdmYzE5M2I1
11
- MjY5YWU0MTAwMmY0NWUyYmE1Y2Y3YjlhNGUzNTRjOTNkZjY4Mzk=
9
+ NjMwMThlNzY2N2QxOWFiODM4OGZiMmM0MGNhMzRlYmZlY2Q5MTM0OTA0OTk2
10
+ YTU2MjBiYjJmOGVkMTFiZmFhZmY5YjZkMTU3YjFhMjEyYmFhYTQwOTJhM2M3
11
+ N2VmMzRlM2UwYjUzODk2YTViMzJlYTNiNTVjNTMzMjRhMDEwMGM=
12
12
  data.tar.gz: !binary |-
13
- NjI4MzU5ZDFlNTVmNGE5ZTJkODU3MDg0YWFkMWZhNmE2ODdhYzFlMWY4OTI4
14
- ZWI0MThiMWQwNmNhMzczMWI4YzUzNzA1ZGNlNTUwMDY0OWUyMzlhZGVlZmUw
15
- MjBmNWQwYmQ1Y2Q3OGQ0NDU1NWM3NDVlN2U0NGU0N2I4ZDNiMTk=
13
+ YTgxNWZjZjRhZjU5ZDgyZWMwNTJlYTJkMGQ0YjczNjkwNTM2NmI4MTcwMmM2
14
+ OWM4YmI4YzZlOWU5Y2RmMTI0OGY5MDc0YWY0NGQxNWU0MzM1MThkZTBhMDFk
15
+ ZGVhZjc2ZjYyMmYxNmIzNjAwMGRiYmFiNTBjZDllZjVhNGRkZmQ=
@@ -2,7 +2,7 @@ module ResqueSerial
2
2
  class AsyncJob
3
3
  class << self
4
4
  def queue
5
- :async
5
+ :sync
6
6
  end
7
7
 
8
8
  # Add a job to queue. Queue name is a class module name
@@ -18,7 +18,8 @@ module ResqueSerial
18
18
  method: method,
19
19
  args: args,
20
20
  }
21
- options[:scope] = target.scope.id.to_s if target.scope
21
+ options[:scope] = target.scope && !target.scope.is_a?(String) ? target.scope.id.to_s : target.scope
22
+ options[:timestamp] = target.timestamp if target.timestamp
22
23
 
23
24
  options
24
25
  end
@@ -27,6 +28,7 @@ module ResqueSerial
27
28
  options.symbolize_keys!
28
29
  model = options[:class].constantize.unscoped.find(options[:id])
29
30
  model.scope = options.delete(:scope)
31
+ model.timestamp = options.delete(:timestamp)
30
32
  model.send options[:method], *options[:args]
31
33
  end
32
34
  end
@@ -29,6 +29,7 @@ module ResqueSerial
29
29
  args: args,
30
30
  }
31
31
  options[:scope] = target.scope.id.to_s if target.scope
32
+ options[:timestamp] = target.timestamp if target.timestamp
32
33
 
33
34
  Resque.redis.rpush "syncjobs:#{queue}", options.to_yaml
34
35
  end
@@ -44,6 +45,7 @@ module ResqueSerial
44
45
  return unless model
45
46
 
46
47
  model.scope = options.delete(:scope)
48
+ model.timestamp = options.delete(:timestamp)
47
49
  model.send options[:method], *options[:args]
48
50
  end
49
51
 
@@ -1,5 +1,5 @@
1
1
  module Resque
2
2
  module Serial
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-serial
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Kazarin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-03 00:00:00.000000000 Z
11
+ date: 2013-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport