Fetch the correct "anonymizeIp" config

Something in jekyll (at least on my 4.0 install) stringifies all config
keys, so `:anonymizeIp` did never fetch the real value.

This change fixes that.
This commit is contained in:
David Schmitt 2020-01-04 11:44:00 +00:00
parent acac96a898
commit ccad6672f7
2 changed files with 2 additions and 2 deletions

View file

@ -38,6 +38,6 @@ class GoogleAnalytics
private
def _get_other_commands(config)
@commands.push(ANONYMIZE_IP_CODE % config.fetch(:anonymizeIp, false))
@commands.push(ANONYMIZE_IP_CODE % config.fetch("anonymizeIp", false))
end
end

View file

@ -28,7 +28,7 @@ class TestGoogleAnalytics < Test::Unit::TestCase
def test_anonymize_true
googleAnalytics = GoogleAnalytics.new( {"id" => "UA-123-456", "anonymizeIp" => true} )
assert_match(/\('set', 'anonymizeIp', false\);/, googleAnalytics.render())
assert_match(/\('set', 'anonymizeIp', true\);/, googleAnalytics.render())
end
end