diff --git a/gems/activemodel/6.0/activemodel-6.0.rbs b/gems/activemodel/6.0/activemodel-6.0.rbs new file mode 100644 index 00000000..d62fc2df --- /dev/null +++ b/gems/activemodel/6.0/activemodel-6.0.rbs @@ -0,0 +1,10 @@ +module ActiveModel + class Errors + # Delete messages for +key+. Returns the deleted messages. + # + # person.errors[:name] # => ["cannot be nil"] + # person.errors.delete(:name) # => ["cannot be nil"] + # person.errors[:name] # => [] + def delete: (untyped key) -> untyped + end +end diff --git a/gems/activemodel/6.0/activemodel-generated.rbs b/gems/activemodel/6.0/activemodel-generated.rbs index a751383e..0334de32 100644 --- a/gems/activemodel/6.0/activemodel-generated.rbs +++ b/gems/activemodel/6.0/activemodel-generated.rbs @@ -1411,13 +1411,6 @@ module ActiveModel alias key? include? - # Delete messages for +key+. Returns the deleted messages. - # - # person.errors[:name] # => ["cannot be nil"] - # person.errors.delete(:name) # => ["cannot be nil"] - # person.errors[:name] # => [] - def delete: (untyped key) -> untyped - # When passed a symbol or a name of a method, returns an array of errors # for the method. # @@ -2901,9 +2894,6 @@ module ActiveModel module Type attr_accessor self.registry: untyped - # Add a new type to the registry, allowing it to be gotten through ActiveModel::Type#lookup - def self.register: (untyped type_name, ?untyped? klass, **untyped options) { () -> untyped } -> untyped - def self.lookup: (*untyped args, **untyped kwargs) -> untyped def self.default_value: () -> untyped diff --git a/gems/activemodel/6.0/activemodel.rbs b/gems/activemodel/6.0/activemodel.rbs index 92e5f202..a5731cdc 100644 --- a/gems/activemodel/6.0/activemodel.rbs +++ b/gems/activemodel/6.0/activemodel.rbs @@ -366,6 +366,13 @@ module ActiveModel end end +module ActiveModel + module Type + # Add a new type to the registry, allowing it to be gotten through ActiveModel::Type#lookup + def self.register: (untyped type_name, ?untyped? klass, **untyped options) ?{ () -> untyped } -> untyped + end +end + module ActiveModel module Validations module ClassMethods diff --git a/gems/activemodel/7.0/activemodel-7.0.rbs b/gems/activemodel/7.0/activemodel-7.0.rbs index 13680671..19a25142 100644 --- a/gems/activemodel/7.0/activemodel-7.0.rbs +++ b/gems/activemodel/7.0/activemodel-7.0.rbs @@ -42,3 +42,14 @@ module ActiveModel def strict_match?: (Symbol | String attribute, (Symbol | String)? type, **untyped options) -> bool end end + +module ActiveModel + class Errors + # Delete messages for +key+. Returns the deleted messages. + # + # person.errors[:name] # => ["cannot be nil"] + # person.errors.delete(:name) # => ["cannot be nil"] + # person.errors[:name] # => [] + def delete: (untyped key, ?untyped type, **untyped) -> untyped + end +end diff --git a/gems/activemodel/7.1/activemodel-7.1.rbs b/gems/activemodel/7.1/activemodel-7.1.rbs index 4c53dfcc..74334fa3 100644 --- a/gems/activemodel/7.1/activemodel-7.1.rbs +++ b/gems/activemodel/7.1/activemodel-7.1.rbs @@ -66,6 +66,17 @@ module ActiveModel end end +module ActiveModel + class Errors + # Delete messages for +key+. Returns the deleted messages. + # + # person.errors[:name] # => ["cannot be nil"] + # person.errors.delete(:name) # => ["cannot be nil"] + # person.errors[:name] # => [] + def delete: (untyped key, ?untyped type, **untyped) -> untyped + end +end + module ActiveModel module Model include ActiveModel::Access