cellect-server 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cellect/server/adapters/postgres.rb +10 -11
- data/lib/cellect/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 662861e6791c0a2f621c9cbe855f30fa86280282
|
4
|
+
data.tar.gz: f2d6a01fb332db3ba9456e130b50774f55c89159
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6513ff370439e2e634138677a9be174a14de38d28ff979a1483c1174c304612b3261773ebad62275747c5efd064ca8f8b566b213782caf8fbefc35480b756860
|
7
|
+
data.tar.gz: eb028c8c78b3cc46d601bc2b71f51a1e815d680774c2d0c3724acb1b9e790bd8cd2473decff7cb43e86a391ad574e53e75b25b5090b0c15e252436b57c0daad6
|
@@ -10,7 +10,7 @@ module Cellect
|
|
10
10
|
PG.connect connection_options
|
11
11
|
end
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def workflow_list
|
15
15
|
with_pg do |pg|
|
16
16
|
pg.exec('SELECT * FROM workflows').collect do |row|
|
@@ -24,16 +24,15 @@ module Cellect
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def load_data_for(workflow_name)
|
29
29
|
with_pg do |pg|
|
30
30
|
statement = <<-SQL
|
31
|
-
SELECT sms.id as id, sms.priority as priority, sms.subject_set_id as group_id
|
31
|
+
SELECT sms.id as id, sms.priority as priority, sms.subject_set_id as group_id
|
32
32
|
FROM workflows w
|
33
|
-
JOIN
|
34
|
-
JOIN
|
35
|
-
|
36
|
-
WHERE w.id = #{ workflow_name }
|
33
|
+
JOIN subject_sets ss ON (ss.workflow_id = w.id)
|
34
|
+
JOIN set_member_subjects sms ON (sms.subject_set_id = ss.id)
|
35
|
+
WHERE w.id = #{ workflow_name }
|
37
36
|
SQL
|
38
37
|
pg.exec(statement).collect do |row|
|
39
38
|
{
|
@@ -44,11 +43,11 @@ module Cellect
|
|
44
43
|
end
|
45
44
|
end
|
46
45
|
end
|
47
|
-
|
46
|
+
|
48
47
|
def load_user(workflow_name, id)
|
49
48
|
with_pg do |pg|
|
50
49
|
statement = <<-SQL
|
51
|
-
SELECT
|
50
|
+
SELECT set_member_subject_ids FROM user_seen_subjects
|
52
51
|
WHERE user_id = #{ id } AND workflow_id = #{ workflow_name }
|
53
52
|
SQL
|
54
53
|
pg.exec(statement).collect do |row|
|
@@ -56,11 +55,11 @@ module Cellect
|
|
56
55
|
end
|
57
56
|
end
|
58
57
|
end
|
59
|
-
|
58
|
+
|
60
59
|
def with_pg
|
61
60
|
@pg.with{ |pg| yield pg }
|
62
61
|
end
|
63
|
-
|
62
|
+
|
64
63
|
def connection_options
|
65
64
|
{
|
66
65
|
host: ENV.fetch('PG_HOST', '127.0.0.1'),
|
data/lib/cellect/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cellect-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Parrish
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|