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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e99eedbb031e30c30aa5a1115f3620f5e2e4cf3
4
- data.tar.gz: 06dbf151721e9abdb0c3c518de248f8809e972a3
3
+ metadata.gz: 662861e6791c0a2f621c9cbe855f30fa86280282
4
+ data.tar.gz: f2d6a01fb332db3ba9456e130b50774f55c89159
5
5
  SHA512:
6
- metadata.gz: e4911bddd166a8258fa63fde6dd767159e848217c736d9c8390496150ba113cd9dbc35b092631a17d300b16670b73cd7e3a7e0bdfdb36052ff6c7c797d462816
7
- data.tar.gz: 02043a81baca72f5d2a640a0d0d4909beae0751265e79bab6b4263ffd78661935b465ad16625c61ea6ad1bbadd051dff79c0ff7d0f20a5f7bfa5b54306999099
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 subject_sets_workflows ssw ON (ssw.workflow_id = w.id)
34
- JOIN subject_sets ss ON (ss.id = ssw.subject_set_id)
35
- JOIN set_member_subjects sms ON (ss.id = sms.subject_set_id)
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 subject_ids FROM user_seen_subjects
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'),
@@ -1,3 +1,3 @@
1
1
  module Cellect
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
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.8
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-13 00:00:00.000000000 Z
11
+ date: 2014-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler