Skip to content

Commit 26e335d

Browse files
committed
Use a constant for the meta property keys we use to generate head keys from
1 parent 2645146 commit 26e335d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/inertia_rails/meta_tag.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class MetaTag
1010
LD_JSON_TYPE = 'application/ld+json'
1111
DEFAULT_SCRIPT_TYPE = 'text/plain'
1212

13+
GENERATABLE_HEAD_KEY_PROPERTIES = %i[name property http_equiv]
14+
1315
def initialize(tag_name: nil, head_key: nil, allow_duplicates: false, type: nil, **tag_data)
1416
if shortened_title_tag?(tag_name, tag_data)
1517
@tag_name = :title
@@ -94,7 +96,7 @@ def generate_meta_head_key
9496
return unless @tag_name == :meta
9597
return 'meta-charset' if @tag_data.key?(:charset)
9698

97-
%i[name property http_equiv].each do |key|
99+
GENERATABLE_HEAD_KEY_PROPERTIES.each do |key|
98100
next unless @tag_data.key?(key)
99101

100102
return [

0 commit comments

Comments
 (0)