You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/onyx-sql/query/set.cr
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -53,13 +53,12 @@ module Onyx::SQL
53
53
{%for key, value inU%}
54
54
{%
55
55
ivar =T.instance_vars.find(&.name.== key)
56
+
raise"Cannot find an instance variable named @#{key} in #{T}"unless ivar
56
57
57
58
not_null = (a = ivar.annotation(Field) || ivar.annotation(Reference)) && a[:not_null]
58
59
raise"On Query(#{T})#set: #{key} is nilable in compilation time (`#{value}`), but #{T}@#{ivar.name} has `not_null` option set to `true`. Consider calling `.not_nil!` on the value"if not_null && value.nilable?
59
60
%}
60
61
61
-
{%raise"Cannot find an instance variable named @#{key} in #{T}"unless ivar %}
0 commit comments