Skip to content

Commit

Permalink
activerecord: Allow to use array of Hashes to #preload (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya authored Oct 30, 2024
1 parent 5848da7 commit f1b4f00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gems/activerecord/6.0/_test/activerecord-generated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Article < ActiveRecord::Base

User.eager_load(:address, friends: [:address, :followers])
User.includes(:address, :friends).to_a
User.preload(:address, friends: [:address, :followers])
User.preload(:address, friends: [:address, { followers: :users }]) # steep:ignore FallbackAny
User.in_order_of(:id, [1, 5, 3])
User.offset(5).limit(10)

Expand Down
24 changes: 12 additions & 12 deletions gems/activerecord/6.0/activerecord.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ module ActiveRecord
def joins: (*String | Symbol | Hash[untyped, untyped]) -> self
def left_joins: (*String | Symbol | Hash[untyped, untyped]) -> self
def left_outer_joins: (*String | Symbol | Hash[untyped, untyped]) -> self
def includes: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> self
def eager_load: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> self
def preload: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> self
def includes: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> self
def eager_load: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> self
def preload: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> self
def find_by: (*untyped) -> Model?
def find_by!: (*untyped) -> Model
def find: (PrimaryKey id) -> Model
Expand Down Expand Up @@ -445,9 +445,9 @@ module ActiveRecord
def joins: (*String | Symbol | Hash[untyped, untyped]) -> Relation
def left_joins: (*String | Symbol | Hash[untyped, untyped]) -> Relation
def left_outer_joins: (*String | Symbol | Hash[untyped, untyped]) -> Relation
def includes: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> Relation
def eager_load: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> Relation
def preload: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> Relation
def includes: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> Relation
def eager_load: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> Relation
def preload: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> Relation
def find_by: (*untyped) -> Model?
def find_by!: (*untyped) -> Model
def find: (PrimaryKey id) -> Model
Expand Down Expand Up @@ -525,9 +525,9 @@ interface _ActiveRecord_Relation[Model, PrimaryKey]
def joins: (*String | Symbol | Hash[untyped, untyped]) -> self
def left_joins: (*String | Symbol | Hash[untyped, untyped]) -> self
def left_outer_joins: (*String | Symbol | Hash[untyped, untyped]) -> self
def includes: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> self
def eager_load: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> self
def preload: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> self
def includes: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> self
def eager_load: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> self
def preload: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> self
def find_by: (untyped, *untyped) -> Model?
def find_by!: (untyped, *untyped) -> Model
def find: (PrimaryKey id) -> Model
Expand Down Expand Up @@ -613,9 +613,9 @@ interface _ActiveRecord_Relation_ClassMethods[Model, Relation, PrimaryKey]
def joins: (*String | Symbol | Hash[untyped, untyped]) -> Relation
def left_joins: (*String | Symbol | Hash[untyped, untyped]) -> Relation
def left_outer_joins: (*String | Symbol | Hash[untyped, untyped]) -> Relation
def includes: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> Relation
def eager_load: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> Relation
def preload: (*String | Symbol | Array[String | Symbol] | Hash[untyped, untyped], **(String | Symbol | Array[String | Symbol] | Hash[untyped, untyped])) -> Relation
def includes: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> Relation
def eager_load: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> Relation
def preload: (*String | Symbol | Array[untyped] | Hash[untyped, untyped], **(String | Symbol | Array[untyped] | Hash[untyped, untyped])) -> Relation
def find_by: (untyped) -> Model?
def find_by!: (untyped) -> Model
def find: (PrimaryKey id) -> Model
Expand Down

0 comments on commit f1b4f00

Please sign in to comment.