Merge pull request #74 from TouchInstinct/fix/bugs

Fixed copyWithout method and decimal encoding
This commit is contained in:
Ivan Babkin 2019-05-21 15:50:33 +03:00 committed by GitHub
commit 1816c2e4b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -1,9 +1,13 @@
{%- import '../../macroses/common.utils.twig' as utils -%}
{%- if fields is not empty -%}
{%- set nullableOptionalFields = [] -%}
{%- for field in fields -%}
{%- if field.nullable or field.optional -%}
{{ field.name }}: Bool = false{%- if not (loop.last) %}, {% endif %}
{%- set nullableOptionalFields = nullableOptionalFields|merge([field]) -%}
{%- endif -%}
{%- endfor -%}
{%- for field in nullableOptionalFields -%}
{{ field.name }}: Bool = false{%- if not (loop.last) %}, {% endif %}
{%- endfor -%}
{%- endif -%}

View File

@ -40,7 +40,7 @@
{%- elseif field.type.type.baseTypeName == "StringDecimal" -%}
{{- self.formatEncodingStringDecimal(field) -}}
{%- elseif field.type.type.baseTypeName == "Decimal" -%}
{{ self.formatFieldName(field.name, isStrongLinkCaptured) -}}.decimalValue
{{ self.formatFieldName(field, isStrongLinkCaptured) -}}.decimalValue
{%- elseif field.type.type.baseTypeName == "DateTimeTimestamp" -%}
Int({{ self.formatFieldName(field, isStrongLinkCaptured) -}}.timeIntervalSince1970)
{%- elseif field.type.type.baseTypeName == "Color" -%}