Skip to content

Commit

Permalink
add: ActiveRecord::QueryMethods::WhereChain#missing
Browse files Browse the repository at this point in the history
Added `ActiveRecord::QueryMethods::WhereChain#missing` in version 6.1 or later.

Fixed to return `::ActiveRecord::QueryMethods::WhereChain` when the `where` method has no argument.
  • Loading branch information
rhiroe committed Jun 11, 2024
1 parent c3dd30b commit ccaa96f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
12 changes: 8 additions & 4 deletions gems/activerecord/6.0/activerecord.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ module ActiveRecord
def none: () -> self
def pluck: (Symbol | String column) -> Array[untyped]
| (*Symbol | String columns) -> Array[Array[untyped]]
def where: (*untyped) -> self
def where: () -> ::ActiveRecord::QueryMethods::WhereChain
| (*untyped) -> self
def not: (*untyped) -> self
def exists?: (*untyped) -> bool
def order: (*untyped) -> self
Expand Down Expand Up @@ -377,7 +378,8 @@ module ActiveRecord
def none: () -> Relation
def pluck: (Symbol | String column) -> Array[untyped]
| (*Symbol | String columns) -> Array[Array[untyped]]
def where: (*untyped) -> Relation
def where: () -> ::ActiveRecord::QueryMethods::WhereChain
| (*untyped) -> Relation
def exists?: (*untyped) -> bool
def any?: () -> bool
| () { (Model) -> boolish } -> bool
Expand Down Expand Up @@ -461,7 +463,8 @@ interface _ActiveRecord_Relation[Model, PrimaryKey]
def none: () -> self
def pluck: (Symbol | String column) -> Array[untyped]
| (*Symbol | String columns) -> Array[Array[untyped]]
def where: (*untyped) -> self
def where: () -> ::ActiveRecord::QueryMethods::WhereChain
| (*untyped) -> self
def not: (*untyped) -> self
def exists?: (*untyped) -> bool
def order: (*untyped) -> self
Expand Down Expand Up @@ -539,7 +542,8 @@ interface _ActiveRecord_Relation_ClassMethods[Model, Relation, PrimaryKey]
def none: () -> Relation
def pluck: (Symbol | String column) -> Array[untyped]
| (*Symbol | String columns) -> Array[Array[untyped]]
def where: (*untyped) -> Relation
def where: () -> ::ActiveRecord::QueryMethods::WhereChain
| (*untyped) -> Relation
def exists?: (*untyped) -> bool
def any?: () -> bool
| () { (Model) -> boolish } -> bool
Expand Down
6 changes: 6 additions & 0 deletions gems/activerecord/6.1/activerecord-6.1.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ module ActiveRecord
class MismatchedForeignKey < StatementInvalid
def initialize: (?primary_key_column: untyped? primary_key_column, ?primary_key: untyped? primary_key, ?target_table: untyped? target_table, ?foreign_key: untyped? foreign_key, ?table: untyped? table, ?binds: untyped? binds, ?sql: untyped? sql, ?message: untyped? message) -> untyped
end

module QueryMethods
class WhereChain
def missing: (*Symbol associations) -> Relation
end
end
end
6 changes: 6 additions & 0 deletions gems/activerecord/7.0/activerecord-7.0.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ module ActiveRecord
extend RuntimeRegistry
end

module QueryMethods
class WhereChain
def missing: (*Symbol associations) -> Relation
end
end

module Encryption
module EncryptableRecord
module ClassMethods
Expand Down
6 changes: 6 additions & 0 deletions gems/activerecord/7.1/activerecord-7.1.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ module ActiveRecord
extend RuntimeRegistry
end

module QueryMethods
class WhereChain
def missing: (*Symbol associations) -> Relation
end
end

module Encryption
module EncryptableRecord
module ClassMethods
Expand Down

0 comments on commit ccaa96f

Please sign in to comment.