7 votes

Topic deleted by author

1 comment

  1. teaearlgraycold
    Link
    I'll follow this project as it develops. I just tested it out on a small Rails project and it seems like there's no support for "Rails Magic". So if I call Model.eager_load(...) or...

    I'll follow this project as it develops. I just tested it out on a small Rails project and it seems like there's no support for "Rails Magic". So if I call Model.eager_load(...) or ActiveRecord::Base.configurations the type checker has no idea what I'm trying to do. Ex:

    app/...rb:40: Method eager_load does not exist on T.class_of(AdminUser) https://srb.help/7003
        40 |        AdminUser
        41 |            .eager_load(:admin_user_roles, :roles)
        https://github.com/sorbet/sorbet/tree/cb98f48c8940783becf5a9037adcde734ba13bf4/rbi/core/module.rbi#L117: Did you mean: Module#autoload?
         117 |  def autoload(_module, filename); end
    
    app/...rb:84: Method configurations does not exist on T.class_of(ActiveRecord::Base) https://srb.help/7003
        84 |    default = ActiveRecord::Base.configurations['default']
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        ???: Did you mean: Kernel#configatron?
    

    If they ever get that figured out I'd be glad to integrate this into projects at work.

    3 votes