activegraph 10.0.0.pre.alpha.10 → 10.0.0.pre.alpha.11
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 +4 -4
- data/lib/neo4j/shared/property.rb +2 -1
- data/lib/neo4j/shared/type_converters.rb +58 -17
- data/lib/neo4j/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 217c3ae41fd67404756345d1b5ea0275eab6b9649ff2bb71f3ee8a95ead6b1b6
|
4
|
+
data.tar.gz: 194cf4f01c0ca88789cbed9d25e7c1b2051cf62958691d8515ec8e57b95ffcc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28747760b9362f5d40ebe356ee3fbb0d37dc021172a80f4b043d9e2be6cb691c31d5cff32a1b28066af6e859d207c9b0fe07bd920ac7b92abffc788faf3afdcb
|
7
|
+
data.tar.gz: 32e2fca54d349147a76c961eae0e2f79effb54ebf2d55632f3c1bccc6e8686aa5abf7e31698e15451a21e74bbb1401fb078d5092092b5b7d9b1710dce4e35f6f
|
@@ -11,7 +11,8 @@ module Neo4j::Shared
|
|
11
11
|
|
12
12
|
attr_reader :_persisted_obj
|
13
13
|
|
14
|
-
|
14
|
+
# This list should not be statically created. All types which have converters should by type casted
|
15
|
+
NEO4J_DRIVER_DATA_TYPES = [Hash, Neo4j::Driver::Types::Bytes, ActiveSupport::Duration, Neo4j::Driver::Types::Point,
|
15
16
|
Neo4j::Driver::Types::OffsetTime, Neo4j::Driver::Types::LocalTime, Neo4j::Driver::Types::LocalDateTime]
|
16
17
|
|
17
18
|
# TODO: Set @attribute correctly using class ActiveModel::Attribute, and after that
|
@@ -28,7 +28,6 @@ module Neo4j::Shared
|
|
28
28
|
NEO4J_LARGEST_INT = 9223372036854775807
|
29
29
|
NEO4J_SMALLEST_INT = -9223372036854775808
|
30
30
|
class << self
|
31
|
-
|
32
31
|
def converted?(value)
|
33
32
|
false
|
34
33
|
end
|
@@ -52,21 +51,22 @@ module Neo4j::Shared
|
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
55
|
-
class FloatConverter < BaseConverter
|
56
|
-
class << self
|
57
|
-
def convert_type
|
58
|
-
Float
|
59
|
-
end
|
60
|
-
|
61
|
-
def db_type
|
62
|
-
Float
|
63
|
-
end
|
64
|
-
|
65
|
-
def to_db(value)
|
66
|
-
value.to_f
|
67
|
-
end
|
68
|
-
|
69
|
-
|
54
|
+
class FloatConverter < BaseConverter
|
55
|
+
class << self
|
56
|
+
def convert_type
|
57
|
+
Float
|
58
|
+
end
|
59
|
+
|
60
|
+
def db_type
|
61
|
+
Float
|
62
|
+
end
|
63
|
+
|
64
|
+
def to_db(value)
|
65
|
+
value.to_f
|
66
|
+
end
|
67
|
+
|
68
|
+
alias to_ruby to_db
|
69
|
+
end
|
70
70
|
end
|
71
71
|
|
72
72
|
class StringConverter < BaseConverter
|
@@ -82,10 +82,33 @@ module Neo4j::Shared
|
|
82
82
|
def to_db(value)
|
83
83
|
value.to_s
|
84
84
|
end
|
85
|
+
|
85
86
|
alias to_ruby to_db
|
86
87
|
end
|
87
88
|
end
|
88
89
|
|
90
|
+
# Converts Java long types to Date objects. Must be timezone UTC.
|
91
|
+
class DateConverter < BaseConverter
|
92
|
+
class << self
|
93
|
+
def convert_type
|
94
|
+
Date
|
95
|
+
end
|
96
|
+
|
97
|
+
def db_type
|
98
|
+
Date
|
99
|
+
end
|
100
|
+
|
101
|
+
def to_ruby(value)
|
102
|
+
value.respond_to?(:to_date) ? value.to_date : Time.at(value).utc.to_date
|
103
|
+
rescue Exception => e
|
104
|
+
raise e
|
105
|
+
end
|
106
|
+
|
107
|
+
alias to_db to_ruby
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
# Converts DateTime objects to and from Java long types. Must be timezone UTC.
|
89
112
|
class DateTimeConverter < BaseConverter
|
90
113
|
class << self
|
91
114
|
def convert_type
|
@@ -94,7 +117,7 @@ module Neo4j::Shared
|
|
94
117
|
|
95
118
|
def db_type
|
96
119
|
Integer
|
97
|
-
end
|
120
|
+
end
|
98
121
|
|
99
122
|
# Converts the given DateTime (UTC) value to an Integer.
|
100
123
|
# DateTime values are automatically converted to UTC.
|
@@ -125,6 +148,24 @@ module Neo4j::Shared
|
|
125
148
|
end
|
126
149
|
end
|
127
150
|
|
151
|
+
class TimeConverter < BaseConverter
|
152
|
+
class << self
|
153
|
+
def convert_type
|
154
|
+
Time
|
155
|
+
end
|
156
|
+
|
157
|
+
def db_type
|
158
|
+
Time
|
159
|
+
end
|
160
|
+
|
161
|
+
def to_ruby(value)
|
162
|
+
value.respond_to?(:to_time) ? value.to_time : Time.at(value).utc
|
163
|
+
end
|
164
|
+
|
165
|
+
alias to_db to_ruby
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
128
169
|
class BooleanConverter < BaseConverter
|
129
170
|
FALSE_VALUES = %w(n N no No NO false False FALSE off Off OFF f F).to_set
|
130
171
|
|
data/lib/neo4j/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activegraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.0.0.pre.alpha.
|
4
|
+
version: 10.0.0.pre.alpha.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Ronge, Brian Underwood, Chris Grigg, Heinrich Klobuczek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|