hello, trying to compare to Time objects, but compiler keeps erroring out on Nil
if host.services.not_nil!
host.services.each do |svc|
if svc.updated_at
Log.warn {svc.updated_at}
Log.warn { typeof(svc.updated_at)}
diff = Time.utc - svc.updated_at
end
end
end
my database object svc.updated_at is a (Time | Nil)
Im adding an existence check, with “if svc.updated at”
compiler fails to compile with
21 | diff = Time.utc - svc.updated_at
^---------
Error: expected argument #1 to 'Time#-' to be Time, not (Time | Nil)