actionable 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/actionable.gemspec +1 -1
- data/lib/actionable/memory_store.rb +2 -2
- data/lib/actionable/mongoid_store/action.rb +4 -3
- data/lib/actionable/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f03b0a7dce60b9d34efb093640194bb0b3ad7e49
|
4
|
+
data.tar.gz: 774e885c475093f721a7b8e60f64ba65d7b71793
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42c77d2cc1bfb40c165603a3c820dd642f99456e812e0952b7e91c462f3191c0b22cc551735540c31e20a246eeb5f2ddd22db1e5d6c0c3d74c8dd898fb77200a
|
7
|
+
data.tar.gz: b1a6de02ede0dbd112ce8890cb22426be8a47a7c587c27ef72f8a12ae6bbb9ffe0c22d116dcf9b7e84512a4a4a9a2818d1578790928be6fe4c320f4b2357cc46
|
data/Gemfile
CHANGED
data/actionable.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_dependency "activesupport", ">= 4.0.0"
|
31
31
|
spec.add_dependency "resque", "~> 1.24.1"
|
32
|
-
spec.add_dependency "mongoid", "
|
32
|
+
spec.add_dependency "mongoid", "~> 4.0.0.alpha2"
|
33
33
|
spec.add_dependency "rufus-scheduler", "~> 2.0.4"
|
34
34
|
|
35
35
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Actionable
|
2
2
|
module MemoryStore
|
3
|
-
|
3
|
+
|
4
4
|
def self.insert(model)
|
5
|
-
key = (model[:id] ||=
|
5
|
+
key = (model[:id] ||= BSON::ObjectId.new.to_s)
|
6
6
|
set(key,model)
|
7
7
|
add(hash["target_#{model[:target_id]}"],model) if model[:target_id].present?
|
8
8
|
model
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'mongoid'
|
2
|
+
require 'moped'
|
2
3
|
|
3
4
|
module Actionable
|
4
5
|
module MongoidStore
|
@@ -14,7 +15,7 @@ module Actionable
|
|
14
15
|
field :payload, type: Hash
|
15
16
|
field :job_class_name, type: String
|
16
17
|
field :status, type: Symbol, default: :new
|
17
|
-
field :target_id, type:
|
18
|
+
field :target_id, type: BSON::ObjectId
|
18
19
|
field :target_class_name, type: String
|
19
20
|
field :exception_message, type: String
|
20
21
|
field :exception_backtrace, type: Array
|
@@ -26,10 +27,10 @@ module Actionable
|
|
26
27
|
|
27
28
|
scope :with_job_class, ->(klass) { where(job_class_name: klass.to_s.classify)}
|
28
29
|
|
29
|
-
scope :scheduled_or_late, where(:status.in => [:scheduled,:late])
|
30
|
+
scope :scheduled_or_late, -> { where(:status.in => [:scheduled,:late]) }
|
30
31
|
|
31
32
|
[:scheduled,:enqueued,:working,:complete,:canceled,:failed,:overdue].each do |status|
|
32
|
-
scope status, where(status: status)
|
33
|
+
scope status, -> { where(status: status) }
|
33
34
|
define_method(:"#{status}?") { self.status == status }
|
34
35
|
end
|
35
36
|
|
data/lib/actionable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Luxemburg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -154,16 +154,16 @@ dependencies:
|
|
154
154
|
name: mongoid
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ~>
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: 4.0.0.alpha2
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ~>
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: 4.0.0.alpha2
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rufus-scheduler
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|