trogdir_models 0.7.6 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bed5a8bae8f6ae7d42f380aabdde8994aa545410
4
- data.tar.gz: 727ff635da38945e033908df6cd7aa5d76fa6b0c
3
+ metadata.gz: bb7232919839c14372e60517fad0eb183e7a5b33
4
+ data.tar.gz: 03cfa3dd0b4b16cd84e3344e820ceb511642cfde
5
5
  SHA512:
6
- metadata.gz: e502de573370d6eab02a338eff4c7ebaf4d9291c117bf7df705488b2134ea61e0e2d7d20bbd995cb70ba4de7de66ef974a5afdd544e21564342a2f91a85ac78f
7
- data.tar.gz: cc3cbe147a7ea0e5bdd3f0f6099e73dc063a06073b2fd078221a3a48b50d96d6b42672f96f6b5ccd836315830897c613ddbc475903f0e62b08d84b6b3c4c21f5
6
+ metadata.gz: 5536d8cc505c3a2992275ab24beb1a3c4c217f979938f1a3c37e01a0542d79b59aeb7d3a7e1203dfe77ee8d3b7e1e905b150ad406622919403d3e53b118d0c85
7
+ data.tar.gz: fb3a8b1ec4c689129b928a00ff5ce8ee6c111cf3bd84fceb1e8486dadf8e0eb3ea107c4f9f86e9c73514947de4229fcac79f26adbf3f67eb5904050567024997
@@ -23,12 +23,35 @@ class Syncinator
23
23
  name
24
24
  end
25
25
 
26
+ def changesets
27
+ Changeset.where('change_syncs.syncinator_id' => id).order_by(created_at: :asc)
28
+ end
29
+
26
30
  def unfinished_changesets
27
31
  Changeset.where(
28
32
  :change_syncs.elem_match => {syncinator_id: id, :run_after.ne => nil}
29
33
  ).order_by(created_at: :asc)
30
34
  end
31
35
 
36
+ # have started but haven't errored or succeeded
37
+ def pending_changesets
38
+ Changeset.where(
39
+ :change_syncs.elem_match => {
40
+ syncinator_id: id, :run_after.ne => nil, :sync_logs.elem_match => {
41
+ :started_at.ne => nil, errored_at: nil, succeeded_at: nil
42
+ }
43
+ }
44
+ ).order_by(created_at: :asc)
45
+ end
46
+
47
+ def errored_changesets
48
+ Changeset.where(
49
+ :change_syncs.elem_match => {
50
+ syncinator_id: id, :run_after.ne => nil, :'sync_logs.errored_at'.exists => true
51
+ }
52
+ ).order_by(created_at: :asc)
53
+ end
54
+
32
55
  def startable_changesets
33
56
  Changeset.where(
34
57
  :change_syncs.elem_match => {syncinator_id: id, :run_after.lt => Time.now }
@@ -1,3 +1,3 @@
1
1
  module TrogdirModels
2
- VERSION = '0.7.6'
2
+ VERSION = '0.8.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trogdir_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Crownoble
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-14 00:00:00.000000000 Z
11
+ date: 2014-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: api-auth