aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:51:43 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:51:43 +0200
commit628e51ff109334223094e30ad1365188bbd7f9c6 (patch)
tree6bf28936ffa0fb4fe2390b933958053daeffbc90 /actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
parent4b6c68dfb810c836f87587a16353317d1a180805 (diff)
downloadrails-628e51ff109334223094e30ad1365188bbd7f9c6.tar.gz
rails-628e51ff109334223094e30ad1365188bbd7f9c6.tar.bz2
rails-628e51ff109334223094e30ad1365188bbd7f9c6.zip
applies new string literal convention in actionpack/lib
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/polymorphic_routes.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/polymorphic_routes.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
index 3156acf615..0b5041b231 100644
--- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
+++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -158,20 +158,20 @@ module ActionDispatch
end
class HelperMethodBuilder # :nodoc:
- CACHE = { 'path' => {}, 'url' => {} }
+ CACHE = { "path" => {}, "url" => {} }
def self.get(action, type)
type = type.to_s
CACHE[type].fetch(action) { build action, type }
end
- def self.url; CACHE['url'.freeze][nil]; end
- def self.path; CACHE['path'.freeze][nil]; end
+ def self.url; CACHE["url".freeze][nil]; end
+ def self.path; CACHE["path".freeze][nil]; end
def self.build(action, type)
prefix = action ? "#{action}_" : ""
suffix = type
- if action.to_s == 'new'
+ if action.to_s == "new"
HelperMethodBuilder.singular prefix, suffix
else
HelperMethodBuilder.plural prefix, suffix
@@ -314,9 +314,9 @@ module ActionDispatch
"#{prefix}#{str}_#{suffix}"
end
- [nil, 'new', 'edit'].each do |action|
- CACHE['url'][action] = build action, 'url'
- CACHE['path'][action] = build action, 'path'
+ [nil, "new", "edit"].each do |action|
+ CACHE["url"][action] = build action, "url"
+ CACHE["path"][action] = build action, "path"
end
end
end