Skip to content

Commit

Permalink
activerecord: Fix AR::Relation#or can take other kinds of relation
Browse files Browse the repository at this point in the history
`ActiveRecord::Relation#or` can take not only the its own kind of
relation but also other kinds of relation.

Example:

    Blog.joins(:articles).merge(Blog.where(id: 1).or(Article.where(id: 1)))
  • Loading branch information
tk0miya committed Feb 14, 2024
1 parent adf714d commit 7efc6e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gems/activerecord/6.0/activerecord.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ module ActiveRecord
def order: (*untyped) -> self
def group: (*Symbol | String) -> untyped
def distinct: () -> self
def or: (self) -> self
def or: (::ActiveRecord::Relation) -> self
def merge: (Array[untyped] | Hash[untyped, untyped] | ActiveRecord::Relation | Proc) -> self
def joins: (*String | Symbol | Hash[untyped, untyped]) -> self
def left_joins: (*String | Symbol | Hash[untyped, untyped]) -> self
Expand Down Expand Up @@ -387,7 +387,7 @@ module ActiveRecord
def order: (*untyped) -> Relation
def group: (*Symbol | String) -> untyped
def distinct: () -> Relation
def or: (Relation) -> Relation
def or: (::ActiveRecord::Relation) -> Relation
def merge: (Array[untyped] | Hash[untyped, untyped] | ActiveRecord::Relation | Proc) -> Relation
def joins: (*String | Symbol | Hash[untyped, untyped]) -> Relation
def left_joins: (*String | Symbol | Hash[untyped, untyped]) -> Relation
Expand Down Expand Up @@ -463,7 +463,7 @@ interface _ActiveRecord_Relation[Model, PrimaryKey]
def order: (*untyped) -> self
def group: (*Symbol | String) -> untyped
def distinct: () -> self
def or: (self) -> self
def or: (::ActiveRecord::Relation) -> self
def merge: (Array[untyped] | Hash[untyped, untyped] | ActiveRecord::Relation | Proc) -> self
def joins: (*String | Symbol | Hash[untyped, untyped]) -> self
def left_joins: (*String | Symbol | Hash[untyped, untyped]) -> self
Expand Down Expand Up @@ -547,7 +547,7 @@ interface _ActiveRecord_Relation_ClassMethods[Model, Relation, PrimaryKey]
def order: (*untyped) -> Relation
def group: (*Symbol | String) -> untyped
def distinct: () -> Relation
def or: (Relation) -> Relation
def or: (::ActiveRecord::Relation) -> Relation
def merge: (Array[untyped] | Hash[untyped, untyped] | ActiveRecord::Relation | Proc) -> Relation
def joins: (*String | Symbol | Hash[untyped, untyped]) -> Relation
def left_joins: (*String | Symbol | Hash[untyped, untyped]) -> Relation
Expand Down

0 comments on commit 7efc6e2

Please sign in to comment.