neo4j 5.0.14 → 5.0.15

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: 9c4b3a230362c94efc4fc7b851289f7e73040b5c
4
- data.tar.gz: 54cfbe6f101c7bc6961d0c3e9fd04d17ede7552a
3
+ metadata.gz: 614d5fb5803862fb5eabc3e58e19fa52dfd707eb
4
+ data.tar.gz: 5c5aab03b675ae7253552b07282132885454eb6d
5
5
  SHA512:
6
- metadata.gz: 368f2f9d83019b2e2b85aeed9dfe0393cf021d865cecad33a9ffad8366fac8d7dfc650a01d8ccfc634334fdf2f0d177d4ac6acace785ed0afa818364e0420dfc
7
- data.tar.gz: e1879aafca3eab1eca58112e13d686516580b74132a91a0abd29bc2be39aa9dbf0a546de63e9d6879691bb26ad9dc1a3bc73bb88779aad59c7b44cda9dde4fef
6
+ metadata.gz: 357f69c5ae85ea3a29661c03ec8bee6ed04123256f1d147f771da7d36fbc224e82f3e403df76c93d2845f3fa8083d5bf73758d7b5ba573d89e638ec8cc34f09c
7
+ data.tar.gz: c82b2d8b33fd3ac9a32880dede8fe2d9cf4aaa726b421f6e2452fb06ff5db71479edaa21614f3c6693f3eb9108b52805d9c74c6508d26ca40a0d3e3dd45f92d3
@@ -19,6 +19,7 @@ module Neo4j
19
19
  end
20
20
 
21
21
  def derive_model_class
22
+ refresh_model_class! if pending_model_refresh?
22
23
  return @model_class unless @model_class.nil?
23
24
  return nil if relationship_class.nil?
24
25
  dir_class = direction == :in ? :from_class : :to_class
@@ -26,14 +27,19 @@ module Neo4j
26
27
  relationship_class.send(dir_class)
27
28
  end
28
29
 
30
+ def refresh_model_class!
31
+ @pending_model_refresh = @target_classes_or_nil = nil
32
+ @model_class = @model_class.name.constantize if @model_class
33
+ end
34
+
35
+ def queue_model_refresh!
36
+ @pending_model_refresh = true
37
+ end
38
+
29
39
  def target_class_option(model_class)
30
40
  case model_class
31
41
  when nil
32
- if @target_class_name_from_name
33
- "#{association_model_namespace}::#{@target_class_name_from_name}"
34
- else
35
- @target_class_name_from_name
36
- end
42
+ @target_class_name_from_name ? "#{association_model_namespace}::#{@target_class_name_from_name}" : @target_class_name_from_name
37
43
  when Array
38
44
  model_class.map { |sub_model_class| target_class_option(sub_model_class) }
39
45
  when false
@@ -49,6 +55,10 @@ module Neo4j
49
55
  direction_cypher(get_relationship_cypher(var, properties, create), create, reverse)
50
56
  end
51
57
 
58
+ def pending_model_refresh?
59
+ !!@pending_model_refresh
60
+ end
61
+
52
62
  def target_class_names
53
63
  option = target_class_option(derive_model_class)
54
64
 
@@ -209,9 +219,7 @@ module Neo4j
209
219
  check_valid_type_and_dir(type, direction)
210
220
  end
211
221
 
212
- VALID_ASSOCIATION_OPTION_KEYS = [:type, :origin, :model_class,
213
- :rel_class, :dependent, :before,
214
- :after, :unique]
222
+ VALID_ASSOCIATION_OPTION_KEYS = [:type, :origin, :model_class, :rel_class, :dependent, :before, :after, :unique]
215
223
 
216
224
  def validate_association_options!(_association_name, options)
217
225
  type_keys = (options.keys & [:type, :origin, :rel_class])
@@ -80,6 +80,12 @@ module Neo4j
80
80
  module ClassMethods
81
81
  include Neo4j::ActiveNode::QueryMethods
82
82
 
83
+ def before_remove_const
84
+ associations.each_value(&:queue_model_refresh!)
85
+ MODELS_FOR_LABELS_CACHE.clear
86
+ WRAPPED_CLASSES.clear
87
+ end
88
+
83
89
  # Returns the object with the specified neo4j id.
84
90
  # @param [String,Integer] id of node to find
85
91
  def find(id)
data/lib/neo4j/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Neo4j
2
- VERSION = '5.0.14'
2
+ VERSION = '5.0.15'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.14
4
+ version: 5.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Ronge, Brian Underwood, Chris Grigg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-09 00:00:00.000000000 Z
11
+ date: 2015-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: orm_adapter