Skip to content

Commit

Permalink
Merge branch 'main' into add/activerecord-querymethods-wherechain-mis…
Browse files Browse the repository at this point in the history
…sing
  • Loading branch information
rhiroe authored Jun 12, 2024
2 parents d1a3ab3 + 4bf1c96 commit 61c46e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
3 changes: 3 additions & 0 deletions gems/activemodel/6.0/_test/test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
class Person
include ActiveModel::Model
include ActiveModel::Validations
attr_accessor :name, :age, :email

validates :name, presence: true, length: { maximum: 100 }
validates :email, presence: true, if: -> { age >= 20 }
end

Person.new.send(:valid?)
14 changes: 0 additions & 14 deletions gems/activemodel/6.0/patch.rbs
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
module ActiveModel
module Serialization
# It is necessary to satisfy alias target.
# TODO: Define this method to correct place.
def `send`: (String name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
end

module Validations
# It is necessary to satisfy alias target.
# TODO: Define this method to correct place.
def `send`: (String name, *untyped args) ?{ (*untyped) -> untyped } -> untyped
end
end

# Remove the fake types for Gem::Version
# if the real types are available.
module Gem
Expand Down
2 changes: 0 additions & 2 deletions gems/activerecord/6.0/activerecord.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ module ActiveRecord
| (*Symbol | String columns) -> Array[Array[untyped]]
def where: () -> ::ActiveRecord::QueryMethods::WhereChain[self]
| (*untyped) -> self
def not: (*untyped) -> self
def exists?: (*untyped) -> bool
def order: (*untyped) -> self
def group: (*Symbol | String) -> untyped
Expand Down Expand Up @@ -479,7 +478,6 @@ interface _ActiveRecord_Relation[Model, PrimaryKey]
| (*Symbol | String columns) -> Array[Array[untyped]]
def where: () -> ::ActiveRecord::QueryMethods::WhereChain[self]
| (*untyped) -> self
def not: (*untyped) -> self
def exists?: (*untyped) -> bool
def order: (*untyped) -> self
def group: (*Symbol | String) -> untyped
Expand Down

0 comments on commit 61c46e3

Please sign in to comment.