safrano 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/odata/complex_type.rb +6 -3
- data/lib/odata/filter/token.rb +1 -1
- data/lib/odata/request/json.rb +2 -5
- data/lib/safrano/service.rb +2 -2
- data/lib/safrano/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: b71032a7ee1e048867f3b54f57d920ba772a44f29a3419a598d2206d50e949c7
|
4
|
+
data.tar.gz: d203df34eda2c7aad9385a84e866d273f1a1f37ba981ffdcc8956de9dad35633
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5cb1583e62f42f9007368204d24f101273049c05e75723dbcd7796732d83e1ac29a1515df0a876a2002c212b0da8204c498070104688fd4b493092072e13dee
|
7
|
+
data.tar.gz: 96aa136d330148331b98943807c83b42e466aa7357c8b360b3f5a66843b9472df41015309b2bef19d993bdabf5f4d1d41e983e7082a1f06d34015370bc87a034
|
data/lib/odata/complex_type.rb
CHANGED
@@ -82,7 +82,11 @@ module Safrano
|
|
82
82
|
|
83
83
|
# needed for ComplexType result
|
84
84
|
def to_odata_json(_req)
|
85
|
-
|
85
|
+
t = self.class.klassmod.output_template
|
86
|
+
innerh = _req.service.get_entity_odata_h(entity: @value, template: t)
|
87
|
+
innerj = innerh.to_json
|
88
|
+
|
89
|
+
"#{DJ_OPEN}#{innerj}#{DJ_CLOSE}"
|
86
90
|
end
|
87
91
|
|
88
92
|
# wrapper
|
@@ -105,7 +109,6 @@ module Safrano
|
|
105
109
|
end
|
106
110
|
|
107
111
|
def to_odata_json(req)
|
108
|
-
# "#{DJ_OPEN}#{{ RESULTSK => coll.map { |c| c.odata_h } }.to_json}#{DJ_CLOSE}"
|
109
112
|
template = self.class.klassmod.output_template
|
110
113
|
# TODO: Error handling if database contains binary BLOB data that cant be
|
111
114
|
# interpreted as UTF-8 then JSON will fail here
|
@@ -226,7 +229,7 @@ module Safrano
|
|
226
229
|
end
|
227
230
|
|
228
231
|
def self.type_name
|
229
|
-
|
232
|
+
namespace ? "#{namespace}.#{self}" : to_s
|
230
233
|
end
|
231
234
|
|
232
235
|
def initialize
|
data/lib/odata/filter/token.rb
CHANGED
data/lib/odata/request/json.rb
CHANGED
@@ -14,12 +14,9 @@ module Safrano
|
|
14
14
|
|
15
15
|
def self.cast_values_in(resd, typ)
|
16
16
|
typ.db_schema.each do |f, props|
|
17
|
-
metadata = typ.cols_metadata[f]
|
18
|
-
|
19
17
|
case props[:type]
|
20
18
|
when :datetime, :date
|
21
19
|
fstr = f.to_s
|
22
|
-
# resd[fstr] = Time.parse(resd[f]) if resd[fstr]
|
23
20
|
resd[fstr] = Sequel.datetime_class.from_edm_json(resd[fstr]) if resd[fstr]
|
24
21
|
end
|
25
22
|
end
|
@@ -48,7 +45,7 @@ module Safrano
|
|
48
45
|
|
49
46
|
if (defered = resd[:__deferred])
|
50
47
|
defered.symbolize_keys!
|
51
|
-
elsif meta = resd[:__metadata]
|
48
|
+
elsif (meta = resd[:__metadata])
|
52
49
|
meta.symbolize_keys!
|
53
50
|
|
54
51
|
# type is normally namespaced ! --> split.last is the class
|
@@ -101,7 +98,7 @@ module Safrano
|
|
101
98
|
|
102
99
|
if (defered = resd[:__deferred])
|
103
100
|
defered.symbolize_keys!
|
104
|
-
elsif meta = resd[:__metadata]
|
101
|
+
elsif (meta = resd[:__metadata])
|
105
102
|
meta.symbolize_keys!
|
106
103
|
|
107
104
|
typ = get_class_from_meta(meta)
|
data/lib/safrano/service.rb
CHANGED
@@ -337,7 +337,7 @@ module Safrano
|
|
337
337
|
end
|
338
338
|
|
339
339
|
def function_import(name_p)
|
340
|
-
name =
|
340
|
+
name = name_p.to_s
|
341
341
|
funcimp = Safrano::FunctionImport(name)
|
342
342
|
@function_imports[name] = funcimp
|
343
343
|
@function_import_keys << name
|
@@ -366,7 +366,7 @@ module Safrano
|
|
366
366
|
|
367
367
|
# need to be sorted by size too
|
368
368
|
def set_funcimports_sorted
|
369
|
-
@function_import_keys.sort_by!
|
369
|
+
@function_import_keys.sort_by!(&:size).reverse!
|
370
370
|
end
|
371
371
|
# to be called at end of publishing block to ensure we get the right names
|
372
372
|
# and additionally build the list of valid attribute path's used
|
data/lib/safrano/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: safrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|