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

activerecord: Add ActiveRecord::Base.offset #675

Merged
merged 1 commit into from
Sep 30, 2024
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
1 change: 1 addition & 0 deletions gems/activerecord/6.0/_test/activerecord-generated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ class Article < ActiveRecord::Base
User.includes(:address, :friends).to_a
User.preload(:address, friends: [:address, :followers])
User.in_order_of(:id, [1, 5, 3])
User.offset(5).limit(10)
6 changes: 6 additions & 0 deletions gems/activerecord/6.0/activerecord.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ module ActiveRecord
def last!: () -> Model
def limit: (Integer | Arel::Nodes::SqlLiteral | nil) -> self
def limit!: (Integer | Arel::Nodes::SqlLiteral | nil) -> self
def offset: (Integer) -> self
def offset!: (Integer) -> self
def find_each: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Model) -> void } -> nil
def find_in_batches: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Array[Model]) -> void } -> nil
def in_batches: (?of: Integer, ?start: Integer, ?finish: Integer, ?load: bool, ?error_on_ignore: bool, ?order: untyped) { (self) -> void } -> nil
Expand Down Expand Up @@ -472,6 +474,7 @@ module ActiveRecord
| (Integer count) -> Array[Model]
def last!: () -> Model
def limit: (Integer | Arel::Nodes::SqlLiteral | nil) -> Relation
def offset: (Integer) -> Relation
def lock: (?untyped locks) -> Relation
def find_each: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Model) -> void } -> nil
def find_in_batches: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Array[Model]) -> void } -> nil
Expand Down Expand Up @@ -553,6 +556,8 @@ interface _ActiveRecord_Relation[Model, PrimaryKey]
def last!: () -> Model
def limit: (Integer | Arel::Nodes::SqlLiteral | nil) -> self
def limit!: (Integer | Arel::Nodes::SqlLiteral | nil) -> self
def offset: (Integer) -> self
def offset!: (Integer) -> self
def find_each: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Model) -> void } -> nil
def find_in_batches: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Array[Model]) -> void } -> nil
def in_batches: (?of: Integer, ?start: Integer, ?finish: Integer, ?load: bool, ?error_on_ignore: bool, ?order: untyped) { (self) -> void } -> nil
Expand Down Expand Up @@ -637,6 +642,7 @@ interface _ActiveRecord_Relation_ClassMethods[Model, Relation, PrimaryKey]
| (Integer count) -> Array[Model]
def last!: () -> Model
def limit: (Integer | Arel::Nodes::SqlLiteral | nil) -> Relation
def offset: (Integer) -> Relation
def lock: (?untyped locks) -> Relation
def find_each: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Model) -> void } -> nil
def find_in_batches: (?batch_size: Integer, ?start: Integer, ?finish: Integer, ?error_on_ignore: bool) { (Array[Model]) -> void } -> nil
Expand Down