Skip to content

Commit

Permalink
Fix issue with reset and specific case when an object is not nilable
Browse files Browse the repository at this point in the history
  • Loading branch information
anykeyh committed Feb 16, 2019
1 parent 6b61193 commit 4fae4a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/clear/model/column.cr
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ class Clear::Model::Column(T, C)
def reset(x : T?)
@changed = false

if T.nilable?
{% if T.nilable? %}
@value = x.as(T)
else
{% else %}
raise null_column_mapping_error(@name, T) if x.nil?
@value = x.not_nil!
end
{% end %}

@old_value = @value
end
Expand Down

0 comments on commit 4fae4a6

Please sign in to comment.