Skip to content

Commit bfa3a5b

Browse files
authored
Merge pull request rails#45699 from jhawthorn/actionview_types_set_constant
Avoid dynamic constant get on SET.symbols
2 parents 225cc78 + 845f19a commit bfa3a5b

File tree

1 file changed

+4
-7
lines changed
  • actionview/lib/action_view/template

1 file changed

+4
-7
lines changed

actionview/lib/action_view/template/types.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,15 @@ def ==(type)
3838
end
3939

4040
class << self
41-
attr_accessor :type_klass
41+
attr_reader :symbols
4242

4343
def delegate_to(klass)
44-
self.type_klass = klass
44+
@symbols = klass::SET.symbols
45+
@type_klass = klass
4546
end
4647

4748
def [](type)
48-
type_klass[type]
49-
end
50-
51-
def symbols
52-
type_klass::SET.symbols
49+
@type_klass[type]
5350
end
5451
end
5552

0 commit comments

Comments
 (0)