Skip to content

Commit 64c8752

Browse files
author
elishadiah
committed
Should quote var name
1 parent fdc4d02 commit 64c8752

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/rbs_rails/active_record.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,17 @@ def reload_#{a.name}: () -> #{type_optional}
260260
args_node.children.each do |node|
261261
case node.type
262262
when :arg
263-
res << "untyped #{node.children[0]}"
263+
res << "untyped `#{node.children[0]}`"
264264
when :optarg
265-
res << "?untyped #{node.children[0]}"
265+
res << "?untyped `#{node.children[0]}`"
266266
when :kwarg
267267
res << "#{node.children[0]}: untyped"
268268
when :kwoptarg
269269
res << "?#{node.children[0]}: untyped"
270270
when :restarg
271-
res << "*untyped #{node.children[0]}"
271+
res << "*untyped `#{node.children[0]}`"
272272
when :kwrestarg
273-
res << "**untyped #{node.children[0]}"
273+
res << "**untyped `#{node.children[0]}`"
274274
when :blockarg
275275
block = " { (*untyped) -> untyped }"
276276
else

test/app/app/models/user.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class User < ApplicationRecord
2-
scope :all_kind_args, -> (a, m = 1, n = 1, *rest, x, k: 1, **kwrest, &blk) { all }
2+
scope :all_kind_args, -> (type, m = 1, n = 1, *rest, x, k: 1,**untyped, &blk) { all }
33
scope :no_arg, -> () { all }
44

55
has_and_belongs_to_many :blogs

test/rbs_rails/active_record_test.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ def will_save_change_to_updated_at?: () -> bool
106106
def restore_updated_at!: () -> void
107107
def clear_updated_at_change: () -> void
108108
109-
def self.all_kind_args: (untyped a, ?untyped m, ?untyped n, *untyped rest, untyped x, ?k: untyped, **untyped kwrest) { (*untyped) -> untyped } -> ActiveRecord_Relation
109+
def self.all_kind_args: (untyped `type`, ?untyped m, ?untyped n, *untyped rest, untyped x, ?k: untyped, **untyped `untyped`) { (*untyped) -> untyped } -> ActiveRecord_Relation
110110
def self.no_arg: () -> ActiveRecord_Relation
111111
112112
class ActiveRecord_Relation < ActiveRecord::Relation
113113
include _ActiveRecord_Relation[User, Integer]
114114
include Enumerable[User]
115115
116-
def all_kind_args: (untyped a, ?untyped m, ?untyped n, *untyped rest, untyped x, ?k: untyped, **untyped kwrest) { (*untyped) -> untyped } -> ActiveRecord_Relation
116+
def all_kind_args: (untyped `type`, ?untyped m, ?untyped n, *untyped rest, untyped x, ?k: untyped, **untyped `untyped`) { (*untyped) -> untyped } -> ActiveRecord_Relation
117117
def no_arg: () -> ActiveRecord_Relation
118118
end
119119
@@ -124,7 +124,7 @@ class ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::Co
124124
end
125125

126126
def app_dir
127-
File.expand_path('../app', __dir__)
127+
File.expand_path('../app', __dir__)
128128
end
129129

130130
def setup!

0 commit comments

Comments
 (0)