aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/template/types.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-01-17 16:10:43 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-01-17 16:31:13 +0100
commiteb4ec6648d313586fd801582f20d845b6c2b7e20 (patch)
treea5be8fb9a268bde45559117236992ba546d7bd11 /actionview/lib/action_view/template/types.rb
parentb1dcfa782e64859f9d03b6cf9474506ac5129337 (diff)
downloadrails-eb4ec6648d313586fd801582f20d845b6c2b7e20.tar.gz
rails-eb4ec6648d313586fd801582f20d845b6c2b7e20.tar.bz2
rails-eb4ec6648d313586fd801582f20d845b6c2b7e20.zip
Don't bother looking up the types.
If they aren't symbols, then they aren't likely to be in the set anyway.
Diffstat (limited to 'actionview/lib/action_view/template/types.rb')
-rw-r--r--actionview/lib/action_view/template/types.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionview/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb
index 4a64467ce9..650023f6c5 100644
--- a/actionview/lib/action_view/template/types.rb
+++ b/actionview/lib/action_view/template/types.rb
@@ -8,9 +8,9 @@ module ActionView
SET = Set.new([ :html, :text, :js, :css, :xml, :json ])
def self.[](type)
- return type if type.is_a?(self)
-
- if type.is_a?(Symbol) || SET.member?(type.to_s)
+ if type.is_a?(self)
+ type
+ else
new(type)
end
end