vidibus-version_scheduler 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -22,8 +22,9 @@ class Book
|
|
22
22
|
end
|
23
23
|
```
|
24
24
|
|
25
|
-
Whenever a version gets created that has a future `created_at` timestamp, a
|
26
|
-
migrate your model to that version at the
|
25
|
+
Whenever a version gets created that has a future `created_at` timestamp, a
|
26
|
+
`DelayedJob` will be created to migrate your model to that version at the
|
27
|
+
specified time. The job will be added to a queue named "versioning".
|
27
28
|
|
28
29
|
|
29
30
|
## TODO
|
@@ -36,7 +36,11 @@ module Vidibus
|
|
36
36
|
def ensure_job
|
37
37
|
return if job
|
38
38
|
if version and Time.now < run_at
|
39
|
-
@job = Delayed::Job.enqueue(MigrationJob.new(version_uuid),
|
39
|
+
@job = Delayed::Job.enqueue(MigrationJob.new(version_uuid), {
|
40
|
+
priority: 1,
|
41
|
+
run_at: run_at,
|
42
|
+
queue: 'versioning'
|
43
|
+
})
|
40
44
|
self.job_id = @job.id
|
41
45
|
end
|
42
46
|
end
|
@@ -14,7 +14,8 @@ module Vidibus
|
|
14
14
|
protected
|
15
15
|
|
16
16
|
def scheduled?(version)
|
17
|
-
version.versioned_type.constantize.
|
17
|
+
version.versioned_type.constantize.
|
18
|
+
ancestors.include?(Vidibus::VersionScheduler::Mongoid)
|
18
19
|
end
|
19
20
|
|
20
21
|
def schedule(version)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vidibus-version_scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mongoid
|
@@ -202,7 +202,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
202
|
version: '0'
|
203
203
|
segments:
|
204
204
|
- 0
|
205
|
-
hash:
|
205
|
+
hash: -1344549885885990962
|
206
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
207
|
none: false
|
208
208
|
requirements:
|