cancancan-neo4j 1.2.0 → 1.2.1

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: c3b85a803fa71306a5981e5c4088db18f510fe9f
4
- data.tar.gz: 6fc3de2b840ebd7bb26e979aed7956d1499231ba
3
+ metadata.gz: 8e08a1d2366ed56a2098252068703e1038e44527
4
+ data.tar.gz: c83757e84d871344219d64e8d6739ac124091bc1
5
5
  SHA512:
6
- metadata.gz: 4afcef739b4b5f44864656692d6da844b0bac734534e7ac18d8cc1355e9ccd00776d7d6292888eb9db5bebab46c59df0bd5a16ffaddfb39925886b2b7109230c
7
- data.tar.gz: f3dd00a1d6fbbd64aeb9e249b73cd4a3e047f6c355c6d94b9807133dcaa4fa5ca91f5011faaeca4c85b00f9ac6cb958f53ac2c127ead78c047fb03fa66deeeb2
6
+ metadata.gz: 9d6d307fca81de261d85d3c0590e791520398dfd54f624edfffd56d8d3e5bd79e3b688fdfe6cb3dbdcaa4d35ba840caefcfd153877f58e83b7cd6197c2ef3781
7
+ data.tar.gz: cffd3d0cde2bf8999ce78fbdba0e179e35c989944a3d6da035fffde35b6ab393ad2f133410d4cadf5e65336e53c6fe2a45c24101ffc9c6197080847a3b819d06
@@ -78,6 +78,7 @@ module CanCan
78
78
  def records_for_multiple_rules
79
79
  base_query = base_query_proxy.query
80
80
  cypher_options = construct_cypher_options
81
+ cypher_options[:matches].reject! { |mt| mt.match(var_name(@model_class)) }
81
82
  match_string = cypher_options[:matches].uniq.join(', ')
82
83
  base_query = base_query.match(match_string) unless match_string.blank?
83
84
  base_query
@@ -20,7 +20,7 @@ module CanCanCan
20
20
  rel_length = associations_conditions.delete(:rel_length)
21
21
  current_path = append_path_to_conditions(relationship, model_conditions, rel_length)
22
22
  append_model_conditions(model_conditions, relationship, current_path)
23
- append_association_conditions(associations_conditions, relationship)
23
+ append_association_conditions(associations_conditions, relationship, rel_length)
24
24
  end
25
25
  end
26
26
 
@@ -28,9 +28,9 @@ module CanCanCan
28
28
  @options[:parent_class].associations[association]
29
29
  end
30
30
 
31
- def append_association_conditions(conditions, relationship)
31
+ def append_association_conditions(conditions, relationship, rel_length)
32
32
  return if conditions.blank?
33
- asso_conditions_obj = AssociationConditions.new(asso_conditions: conditions, parent_class: relationship.target_class, path: path_with_relationship(relationship))
33
+ asso_conditions_obj = AssociationConditions.new(asso_conditions: conditions, parent_class: relationship.target_class, path: path_with_relationship(relationship, rel_length))
34
34
  append_and_to_conditions_string
35
35
  @conditions_string += asso_conditions_obj.conditions_string
36
36
  @cypher_matches += asso_conditions_obj.cypher_matches
@@ -68,8 +68,9 @@ module CanCanCan
68
68
  @conditions_string += con_string
69
69
  end
70
70
 
71
- def path_with_relationship(relationship)
72
- @options[:path] + relationship.arrow_cypher + '()'
71
+ def path_with_relationship(relationship, rel_length)
72
+ arrow_cypher = relationship.arrow_cypher(nil, {}, false, false, rel_length)
73
+ @options[:path] + arrow_cypher + '()'
73
74
  end
74
75
  end
75
76
  end
@@ -2,6 +2,6 @@ module CanCanCan
2
2
  end
3
3
  module CanCanCan
4
4
  module Neo4j
5
- VERSION = '1.2.0'.freeze
5
+ VERSION = '1.2.1'.freeze
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cancancan-neo4j
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amit Suryavanshi