graph_starter 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47a9f8cc99f25f8bd774204ee058e875ae59796e
4
- data.tar.gz: 7c764770c6b64a5f5a0df814930489a013846a94
3
+ metadata.gz: 0ec68f902c939f0d9fa77a0bd809f7bd028306a4
4
+ data.tar.gz: 8f25eef0ecd140167da7192396ffbb35f6df2ce1
5
5
  SHA512:
6
- metadata.gz: 3851899c4e50fe3eed296ae8de286ea594ba6d2f311d9f4d6068771ef2944da7d3684c2f14a01fd002ccb8342ce5558b8fa392f5fb004ded4bc9a5d0b646ff4c
7
- data.tar.gz: d50223200f167ab6b991c16a9a7f89c8981218cf5e80f04ab31897141dd0ae7d8abd347a428a69333be53255fb5baa58c9d3b5918efb561b06aea9142d52b7be
6
+ metadata.gz: e953e46300491928880f94d64fde22b4668f9a086a977c927a320c02810f811f69100c2586b4313f9c568d274ae2d166087ca1b7a0ea844eb42763cff9aa2066
7
+ data.tar.gz: a7a320754fcbde4de9e04e5c4b04bd40e5d1206e402119cf52f51576a367b5af242345dcfb2c02ccc0808dcfa849b35214995b25ac809883da2c7774eec0594d
@@ -2,8 +2,6 @@
2
2
  #= require jquery_ujs
3
3
  #= require turbolinks
4
4
  #= require graph_starter/underscore
5
- #= require graph_starter/ember
6
- #= require graph_starter/ember-template-compiler
7
5
  #= require semantic-ui
8
6
 
9
7
 
@@ -304,12 +304,16 @@ module GraphStarter
304
304
  require 'graph_starter/query_authorizer'
305
305
 
306
306
  query, associations = if category_associations.size > 0
307
- where_clause = category_associations.map do |association_name|
307
+ query = all(:asset).query
308
+
309
+ query = category_associations.each_with_index.inject(query) do |query, (association_name, i)|
308
310
  category_association = self.associations[association_name]
309
- "(asset)#{category_association.arrow_cypher}(category:#{category_association.target_class})"
310
- end.join(' OR ')
311
+ clause = "(asset)#{category_association.arrow_cypher}(category:#{category_association.target_class})"
312
+
313
+ query.optional_match(clause).with(:asset, "#{"categories#{i-1} +" if i > 0} collect(category) AS categories#{i}")
314
+ end.unwind(category: "categories#{category_associations.size - 1}")
311
315
 
312
- [all(:asset).query.optional_match(:category).where(where_clause),
316
+ [query,
313
317
  [:asset, :category]]
314
318
  else
315
319
  [all(:asset),
@@ -26,7 +26,7 @@ script type="text/x-handlebars"
26
26
  th colspan="3"
27
27
  h2
28
28
  i class="#{result_type == 'user' ? 'user' : 'users'} icon"
29
- = result_type.humanize.pluralize
29
+ = result_type.humanize.pluralize
30
30
  | {{#each #{result_type}_results as |result|}}
31
31
  tr
32
32
  td
@@ -40,8 +40,8 @@ html
40
40
 
41
41
  = yield
42
42
 
43
- - if @current_user_is_admin
43
+ /- if @current_user_is_admin
44
44
  #change-object-permissions
45
45
 
46
- - if !request.env['HTTP_X_XHR_REFERER']
46
+ /- if !request.env['HTTP_X_XHR_REFERER']
47
47
  = render partial: 'layouts/graph_starter/change_permissions_modal', locals: {asset: @asset}
@@ -1,3 +1,3 @@
1
1
  module GraphStarter
2
- VERSION = "0.11.0"
2
+ VERSION = "0.11.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graph_starter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-12 00:00:00.000000000 Z
11
+ date: 2015-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails