This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
rbi:models generates a String type sig instead of T.nilable(String) #402
Labels
bug
Something isn't working
Describe the bug:
Hi,
This project looks promising, thanks.
I'm barely dipping my toes into the sorbet world so forgive me if I'm misunderstanding something.
Executing the following command generates wrong column definitions:
I'm using PostgreSQL server 13.1
Steps to reproduce:
I'm developing an app in the open so I could provide a link if required (the setup is docker based). Otherwise the following screenshots should make things clear I think.
I have 2 tables backed by an activerecord model. Each of them, have the same column name "name"
However, I made a mistake and forgot to declare
name
NON NULL
on thefamilies
table upon the first migration.This is the types of bug inducing errors I'd like to catch with sorbet-rails.
Expected behavior:
The generated signature does not reflect the nullable nature of the column.
Instead, I have to override to with my own definition
Versions:
But it seems all the info is available to the runtime though, so the signature should be correctly generated. Is this normal behavior?
I prefer to deal with
structure.sql
dumps, but I also generated aschema.rb
file to ensure that wouldn't be a problem (none of those files seem to be used by the gem though).Thanks for your feedback.
The text was updated successfully, but these errors were encountered: