File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ public extension Entity {
1818
1919 var convertedValues = ValuesObject ( )
2020
21- /*
2221 // convert attributes
2322 for (key, attribute) in self . attributes {
2423
@@ -65,15 +64,14 @@ public extension Entity {
6564
6665 convertedValues [ key] = value
6766 }
68- */
6967
7068 // convert relationships
7169 for (key, relationship) in self . relationships {
7270
71+ let convertedValue : Value
72+
7373 if let jsonValue = JSONObject [ key] {
7474
75- let convertedValue : Value
76-
7775 switch relationship. type {
7876
7977 case . ToOne:
@@ -91,11 +89,11 @@ public extension Entity {
9189
9290 convertedValue = . Relationship( . ToMany( resourceIDs) )
9391 }
94-
95- convertedValues [ key] = convertedValue
9692 }
9793
98- else { convertedValues [ key] = . Null }
94+ else { convertedValue = . Null }
95+
96+ convertedValues [ key] = convertedValue
9997 }
10098
10199 return convertedValues
You can’t perform that action at this time.
0 commit comments