Skip to content
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

Add type definitions to delete_all #713

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions gems/activerecord/6.0/activerecord-generated.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ module ActiveRecord
# @author.books.delete_all(:delete_all)
#
# See delete for more info.
def delete_all: (?untyped? dependent) -> untyped
def delete_all: (?Symbol dependent) -> Integer

# Destroy all the records from this association.
#
Expand Down Expand Up @@ -1232,7 +1232,7 @@ module ActiveRecord
#
# Pet.find(1, 2, 3)
# # => ActiveRecord::RecordNotFound: Couldn't find all Pets with 'id': (1, 2, 3)
def delete_all: (?untyped? dependent) -> untyped
def delete_all: (?Symbol dependent) -> Integer

# Deletes the records of the collection directly from the database
# ignoring the +:dependent+ option. Records are instantiated and it
Expand Down Expand Up @@ -19574,7 +19574,7 @@ module ActiveRecord
#
# Post.distinct.delete_all
# # => ActiveRecord::ActiveRecordError: delete_all doesn't support distinct
def delete_all: () -> untyped
def delete_all: () -> Integer

# Finds and destroys all records matching the specified conditions.
# This is short-hand for <tt>relation.where(condition).destroy_all</tt>.
Expand Down
8 changes: 4 additions & 4 deletions gems/activerecord/6.0/activerecord.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ module ActiveRecord
def in_batches: (?of: Integer, ?start: Integer, ?finish: Integer, ?load: bool, ?error_on_ignore: bool, ?order: untyped) { (self) -> void } -> nil
def sum: (?untyped? column_name) -> Integer
def destroy_all: () -> untyped
def delete_all: () -> untyped
def delete_all: () -> Integer
def update_all: (*untyped) -> untyped
def touch_all: (*untyped, ?time: untyped) -> untyped
def destroy_by: (*untyped) -> untyped
Expand Down Expand Up @@ -494,7 +494,7 @@ module ActiveRecord
def in_batches: (?of: Integer, ?start: Integer, ?finish: Integer, ?load: bool, ?error_on_ignore: bool, ?order: untyped) { (Relation) -> void } -> nil
def sum: (?untyped? column_name) -> Integer
def destroy_all: () -> untyped
def delete_all: () -> untyped
def delete_all: () -> Integer
def update_all: (*untyped) -> untyped
def touch_all: (*untyped, ?time: untyped) -> untyped
def destroy_by: (*untyped) -> untyped
Expand Down Expand Up @@ -576,7 +576,7 @@ interface _ActiveRecord_Relation[Model, PrimaryKey]
def in_batches: (?of: Integer, ?start: Integer, ?finish: Integer, ?load: bool, ?error_on_ignore: bool, ?order: untyped) { (self) -> void } -> nil
def sum: (?untyped? column_name) -> Integer
def destroy_all: () -> untyped
def delete_all: () -> untyped
def delete_all: () -> Integer
def update_all: (untyped) -> untyped
def touch_all: (*untyped, ?time: untyped) -> untyped
def destroy_by: (*untyped) -> untyped
Expand Down Expand Up @@ -662,7 +662,7 @@ interface _ActiveRecord_Relation_ClassMethods[Model, Relation, PrimaryKey]
def in_batches: (?of: Integer, ?start: Integer, ?finish: Integer, ?load: bool, ?error_on_ignore: bool, ?order: untyped) { (Relation) -> void } -> nil
def sum: (?untyped? column_name) -> Integer
def destroy_all: () -> untyped
def delete_all: () -> untyped
def delete_all: () -> Integer
def update_all: (untyped) -> untyped
def touch_all: (*untyped, ?time: untyped) -> untyped
def destroy_by: (*untyped) -> untyped
Expand Down