Skip to content
Merged
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
5 changes: 5 additions & 0 deletions gems/activerecord/7.2/_test/activerecord-7.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,9 @@ class Article < ApplicationRecord
User.with_recursive(admin_users: User.where(role: 0))

ActiveRecord::Base.lease_connection.execute('SELECT * FROM users LIMIT 100;')

User.unscope(:order)
User.order(:id).unscope(:order)
User.reorder(id: :asc)
User.order(id: :asc).reorder(id: :desc)
end
8 changes: 8 additions & 0 deletions gems/activerecord/7.2/activerecord-7.2.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ module ActiveRecord
def with: (*untyped args) -> self
def with_recursive: (*untyped) -> self
def with_recursive!: (*untyped) -> self
def reorder: (*untyped args) -> self
def unscope: (*untyped args) -> self
def sole: () -> Model
end
end
Expand All @@ -236,6 +238,8 @@ module ActiveRecord
module ClassMethods[Model, Relation, PrimaryKey]
def with: (*untyped args) -> Relation
def with_recursive: (*untyped) -> Relation
def reorder: (*untyped args) -> Relation
def unscope: (*untyped args) -> Relation
end
end
end
Expand All @@ -252,6 +256,8 @@ interface _ActiveRecord_Relation[Model, PrimaryKey] # rubocop:disable RBS/Lint/T
def order: (*untyped) -> self
def group: (*Symbol | String) -> untyped
def in_order_of: (Symbol, Array[untyped]) -> self
def reorder: (*untyped args) -> self
def unscope: (*untyped args) -> self
def distinct: () -> self
def or: (::ActiveRecord::Relation) -> self
def merge: (Array[untyped] | Hash[untyped, untyped] | ActiveRecord::Relation | Proc) -> self
Expand Down Expand Up @@ -350,6 +356,8 @@ interface _ActiveRecord_Relation_ClassMethods[Model, Relation, PrimaryKey] # rub
def order: (*untyped) -> Relation
def group: (*Symbol | String) -> untyped
def in_order_of: (Symbol, Array[untyped]) -> Relation
def reorder: (*untyped args) -> Relation
def unscope: (*untyped args) -> Relation
def distinct: () -> Relation
def or: (::ActiveRecord::Relation) -> Relation
def merge: (Array[untyped] | Hash[untyped, untyped] | ActiveRecord::Relation | Proc) -> Relation
Expand Down
5 changes: 5 additions & 0 deletions gems/activerecord/8.0/_test/activerecord-8.0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,9 @@ class Article < ApplicationRecord
User.with_recursive(admin_users: User.where(role: 0))

ActiveRecord::Base.lease_connection.execute('SELECT * FROM users LIMIT 100;')

User.unscope(:order)
User.order(:id).unscope(:order)
User.reorder(id: :asc)
User.order(id: :asc).reorder(id: :desc)
end
8 changes: 8 additions & 0 deletions gems/activerecord/8.0/activerecord-8.0.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ module ActiveRecord
def with: (*untyped args) -> self
def with_recursive: (*untyped) -> self
def with_recursive!: (*untyped) -> self
def reorder: (*untyped args) -> self
def unscope: (*untyped args) -> self
def sole: () -> Model
end
end
Expand All @@ -236,6 +238,8 @@ module ActiveRecord
module ClassMethods[Model, Relation, PrimaryKey]
def with: (*untyped args) -> Relation
def with_recursive: (*untyped) -> Relation
def reorder: (*untyped args) -> Relation
def unscope: (*untyped args) -> Relation
end
end
end
Expand All @@ -252,6 +256,8 @@ interface _ActiveRecord_Relation[Model, PrimaryKey] # rubocop:disable RBS/Lint/T
def order: (*untyped) -> self
def group: (*Symbol | String) -> untyped
def in_order_of: (Symbol, Array[untyped]) -> self
def reorder: (*untyped args) -> self
def unscope: (*untyped args) -> self
def distinct: () -> self
def or: (::ActiveRecord::Relation) -> self
def merge: (Array[untyped] | Hash[untyped, untyped] | ActiveRecord::Relation | Proc) -> self
Expand Down Expand Up @@ -350,6 +356,8 @@ interface _ActiveRecord_Relation_ClassMethods[Model, Relation, PrimaryKey] # rub
def order: (*untyped) -> Relation
def group: (*Symbol | String) -> untyped
def in_order_of: (Symbol, Array[untyped]) -> Relation
def reorder: (*untyped args) -> Relation
def unscope: (*untyped args) -> Relation
def distinct: () -> Relation
def or: (::ActiveRecord::Relation) -> Relation
def merge: (Array[untyped] | Hash[untyped, untyped] | ActiveRecord::Relation | Proc) -> Relation
Expand Down