diff --git a/shard.yml b/shard.yml index ece90ff..269449d 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: active-model -version: 4.3.1 +version: 4.3.2 crystal: ">= 1.0.0" license: MIT diff --git a/src/active-model/model.cr b/src/active-model/model.cr index d5b230b..3360c53 100644 --- a/src/active-model/model.cr +++ b/src/active-model/model.cr @@ -352,7 +352,7 @@ abstract class ActiveModel::Model def assign_attributes(model : {{@type.name}}) {% for name, opts in FIELDS %} {% if opts[:mass_assign] == true %} - self.{{name.id}} = model.{{name.id}} if model.{{name.id}}_assigned? + self.{{name.id}} = model.{{name.id}} if model.{{name.id}}_assigned? || model.{{name.id}}_present? {% end %} {% end %} end