From 5bab7388cf50a5d576ad1eb9733cd5b9dcc9b823 Mon Sep 17 00:00:00 2001 From: Ufuk Kayserilioglu Date: Mon, 8 Aug 2022 19:10:30 +0300 Subject: [PATCH] Revert "Make ActiveRecord#find return value typed" --- lib/tapioca/dsl/compilers/active_record_relations.rb | 2 +- spec/tapioca/dsl/compilers/active_record_relations_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tapioca/dsl/compilers/active_record_relations.rb b/lib/tapioca/dsl/compilers/active_record_relations.rb index e026626e5..676d38274 100644 --- a/lib/tapioca/dsl/compilers/active_record_relations.rb +++ b/lib/tapioca/dsl/compilers/active_record_relations.rb @@ -522,7 +522,7 @@ def create_common_methods(common_relation_methods_module) parameters: [ create_rest_param("args", type: "T.untyped"), ], - return_type: "T.any(#{constant_name}, T::Array[#{constant_name}])" + return_type: "T.untyped" ) when :find_by create_common_method( diff --git a/spec/tapioca/dsl/compilers/active_record_relations_spec.rb b/spec/tapioca/dsl/compilers/active_record_relations_spec.rb index 72e4ad028..cf365149a 100644 --- a/spec/tapioca/dsl/compilers/active_record_relations_spec.rb +++ b/spec/tapioca/dsl/compilers/active_record_relations_spec.rb @@ -93,7 +93,7 @@ def fifth; end sig { returns(::Post) } def fifth!; end - sig { params(args: T.untyped).returns(T.any(::Post, T::Array[::Post])) } + sig { params(args: T.untyped).returns(T.untyped) } def find(*args); end sig { params(args: T.untyped).returns(T.nilable(::Post)) }