-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update activerecord.rbi to account for new preferred method for model validations #1932
Comments
I'm not sure what error you're running into. Is there an issue with using |
Yes. It comes up and method doesn't exist on T.class_of(Model). And looking at the rbi for active record it's using the older 'validates_<presence|uniquness|etc>_of'. I had updated it manually to have 'def validaties(*attributes, **opts); end' but I'm not sure how safe/accurate that is. |
It should be defined in It should be loaded if you have |
Huh, good to know. But it wasn't recognizing it. I had run the tapioca init/annotations/dsl commands multiple times and it wasn't until I added it to the active_record rbi that it stopped raising the error. Is there a specific require that's needed in the tapioca require.rb? I know that models inherit from |
You need to make sure you depend on |
Ahh ok. So if It's not recognizing some rails dep or any other gem, I do the above. Sounds good thank you! Sorry for my confusion on this part. I have exp with sorbet just not on the initial set up :( thanks again! |
Yes |
In the active_record RBI file, it has the validations but they are the older style, e.g.v
def validates_presence_of(*attr_names); end
. I found a workaround for the issue withhas_many
, here.Would be nice to have support for the newer syntax, is there any workaround like for the
has_many
issue?The text was updated successfully, but these errors were encountered: