cancancan-neo4j 1.2.0 → 1.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e08a1d2366ed56a2098252068703e1038e44527
|
4
|
+
data.tar.gz: c83757e84d871344219d64e8d6739ac124091bc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|