From e6285ecc701f8dab10c3ae76fbb331576820907d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 29 Aug 2022 14:26:14 -0400 Subject: [PATCH 1/2] Rails.application.config is untyped This method returns a hash like object that responds to any method, if there is a key with that method name. Since we can't know statically what methods it responds to, we should not be returning a `Configuration` object. --- rbi/annotations/railties.rbi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rbi/annotations/railties.rbi b/rbi/annotations/railties.rbi index 44642a34..6b58f7ba 100644 --- a/rbi/annotations/railties.rbi +++ b/rbi/annotations/railties.rbi @@ -26,7 +26,7 @@ module Rails end class Rails::Application < ::Rails::Engine - sig { returns(Rails::Application::Configuration) } + sig { returns(T.untyped) } def config; end end From 64df8356bc199d64708bb870533a923d9bf196d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 29 Aug 2022 14:31:38 -0400 Subject: [PATCH 2/2] Remove duplicated mixes_in_class_method call Tapioca is already generating those --- rbi/annotations/railties.rbi | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/rbi/annotations/railties.rbi b/rbi/annotations/railties.rbi index 6b58f7ba..cdc9a588 100644 --- a/rbi/annotations/railties.rbi +++ b/rbi/annotations/railties.rbi @@ -30,23 +30,11 @@ class Rails::Application < ::Rails::Engine def config; end end -module Rails::Command::Behavior - mixes_in_class_methods ::Rails::Command::Behavior::ClassMethods -end - class Rails::Engine < ::Rails::Railtie sig { returns(ActionDispatch::Routing::RouteSet) } def routes(&block); end end -module Rails::Generators::Migration - mixes_in_class_methods ::Rails::Generators::Migration::ClassMethods -end - -module Rails::Initializable - mixes_in_class_methods ::Rails::Initializable::ClassMethods -end - class Rails::Railtie sig { params(block: T.proc.bind(Rails::Railtie).void).void } def configure(&block); end