Skip to content

Commit

Permalink
Enable rubocop-on-rbs to activemodel
Browse files Browse the repository at this point in the history
  • Loading branch information
ksss committed Jan 19, 2025
1 parent 6f485a9 commit e8b55b8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
8 changes: 8 additions & 0 deletions gems/activemodel/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inherit_from: ../../.rubocop.yml

RBS/Layout:
Enabled: true
RBS/Lint:
Enabled: true
RBS/Style:
Enabled: true
30 changes: 15 additions & 15 deletions gems/activemodel/6.0/activemodel-generated.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ module ActiveModel

def type_cast: () -> untyped

def initialized?: () -> ::TrueClass
def initialized?: () -> true

def came_from_user?: () -> ::FalseClass
def came_from_user?: () -> false

def has_been_read?: () -> untyped

Expand Down Expand Up @@ -136,7 +136,7 @@ module ActiveModel
# :nodoc:
def type_cast: (untyped value) -> untyped

def changed_in_place?: () -> ::FalseClass
def changed_in_place?: () -> false
end

class Null < Attribute
Expand Down Expand Up @@ -166,7 +166,7 @@ module ActiveModel

def value_for_database: () -> nil

def initialized?: () -> ::FalseClass
def initialized?: () -> false

def forgetting_assignment: () -> untyped

Expand Down Expand Up @@ -648,7 +648,7 @@ module ActiveModel
# :nodoc:
def initialize: (untyped attributes, ?::Hash[untyped, untyped] forced_changes) -> untyped

def changed_in_place?: (untyped attr_name) -> ::FalseClass
def changed_in_place?: (untyped attr_name) -> false

def change_to_attribute: (untyped attr_name) -> untyped

Expand Down Expand Up @@ -685,11 +685,11 @@ module ActiveModel

def change_to_attribute: (untyped attr_name) -> nil

def any_changes?: () -> ::FalseClass
def any_changes?: () -> false

def changed?: (untyped attr_name) -> ::FalseClass
def changed?: (untyped attr_name) -> false

def changed_in_place?: (untyped attr_name) -> ::FalseClass
def changed_in_place?: (untyped attr_name) -> false

def original_value: (untyped attr_name) -> nil
end
Expand Down Expand Up @@ -1864,7 +1864,7 @@ module ActiveModel
#
# person = Person.new(id: 1, name: 'bob')
# person.persisted? # => false
def persisted?: () -> ::FalseClass
def persisted?: () -> false
end
end

Expand Down Expand Up @@ -2407,7 +2407,7 @@ module ActiveModel
# :nodoc:
def type: () -> :binary

def binary?: () -> ::TrueClass
def binary?: () -> true

def cast: (untyped value) -> untyped

Expand Down Expand Up @@ -2557,7 +2557,7 @@ module ActiveModel
module Helpers
# :nodoc: all
class AcceptsMultiparameterTime < Module
def initialize: (?defaults: ::Hash[untyped, untyped] defaults) -> (nil | untyped)
def initialize: (?defaults: ::Hash[untyped, untyped] defaults) -> void
end
end
end
Expand Down Expand Up @@ -2800,7 +2800,7 @@ module ActiveModel

def type_cast_for_schema: (untyped value) -> untyped

def binary?: () -> ::FalseClass
def binary?: () -> false

# Determines whether a value has changed for dirty checking. +old_value+
# and +new_value+ will always be type-cast. Types should not need to
Expand All @@ -2824,11 +2824,11 @@ module ActiveModel
# +deserialize+.
#
# +new_value+ The current value, after type casting.
def changed_in_place?: (untyped raw_old_value, untyped new_value) -> ::FalseClass
def changed_in_place?: (untyped raw_old_value, untyped new_value) -> false

def value_constructed_by_mass_assignment?: (untyped _value) -> ::FalseClass
def value_constructed_by_mass_assignment?: (untyped _value) -> false

def force_equality?: (untyped _value) -> ::FalseClass
def force_equality?: (untyped _value) -> false

def map: (untyped value) { (untyped) -> untyped } -> untyped

Expand Down

0 comments on commit e8b55b8

Please sign in to comment.