Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tapioca/dsl/compilers/active_record_relations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def create_common_methods
create_common_method(
"destroy_all",
return_type: "T::Array[#{constant_name}]",
)
) unless RELATION_METHODS.include? :destroy_all
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to remove this completely, looks like it's been there since Rails 3. So I don't see how this include? will fail for Tapioca's Rails > 8.0 requirement.

create_common_method(
  "destroy_all",
  return_type: "T::Array[#{constant_name}]",
)


FINDER_METHODS.each do |method_name|
case method_name
Expand Down
6 changes: 0 additions & 6 deletions spec/tapioca/dsl/compilers/active_record_relations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ def destroy(*records); end
sig { returns(T::Array[::Post]) }
def destroy_all; end

sig { returns(T::Array[::Post]) }
def destroy_all; end

sig { params(args: T.untyped).returns(T::Array[::Post]) }
def destroy_by(*args); end

Expand Down Expand Up @@ -854,9 +851,6 @@ def destroy(*records); end
sig { returns(T::Array[::Post]) }
def destroy_all; end

sig { returns(T::Array[::Post]) }
def destroy_all; end

sig { params(args: T.untyped).returns(T::Array[::Post]) }
def destroy_by(*args); end

Expand Down
Loading