From 41ebb5564d0ea5511c48910863814627acf91f94 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sun, 17 Jan 2016 15:20:35 +0100 Subject: [PATCH] Make ref return the internal symbol. We delegate to_sym to the internal symbol, which we've already called to_sym on in initialize, so we don't need to do that. We also know to_sym will never return a falsy value, so we'll never hit to_s. Just return the symbolized symbol. --- actionview/lib/action_view/template/types.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionview/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb index be45fcf742..bc805de348 100644 --- a/actionview/lib/action_view/template/types.rb +++ b/actionview/lib/action_view/template/types.rb @@ -32,7 +32,7 @@ def initialize(symbol) alias to_str to_s def ref - to_sym || to_s + @symbol end def ==(type) -- GitLab