Update class template to allow nil attributes values
This commit is contained in:
parent
ec574364a3
commit
ed31a3bb64
|
@ -24,7 +24,7 @@ class <%= cls.generated_class_name %><% if cls.base_ref %> < <%= cls.base_ref.ge
|
||||||
# Update properties of this object
|
# Update properties of this object
|
||||||
def update!(**args)
|
def update!(**args)
|
||||||
<% for property in cls.properties.values -%>
|
<% for property in cls.properties.values -%>
|
||||||
@<%= property.generated_name %> = args[:<%= property.generated_name %>] unless args[:<%= property.generated_name %>].nil?
|
@<%= property.generated_name %> = args[:<%= property.generated_name %>] if args.key?(:<%= property.generated_name %>)
|
||||||
<% end -%>
|
<% end -%>
|
||||||
end
|
end
|
||||||
<% for child_class in cls.properties.values -%>
|
<% for child_class in cls.properties.values -%>
|
||||||
|
|
Loading…
Reference in New Issue