aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/naming.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:38:02 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:38:02 +0200
commit18a2513729ab90b04b1c86963e7d5b9213270c81 (patch)
tree6e9a7bca134f5c98e291dbc694464d6a57a27f6a /activemodel/lib/active_model/naming.rb
parent9617db2078e8a85c8944392c21dd748f932bbd80 (diff)
downloadrails-18a2513729ab90b04b1c86963e7d5b9213270c81.tar.gz
rails-18a2513729ab90b04b1c86963e7d5b9213270c81.tar.bz2
rails-18a2513729ab90b04b1c86963e7d5b9213270c81.zip
applies new string literal convention in activemodel/lib
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'activemodel/lib/active_model/naming.rb')
-rw-r--r--activemodel/lib/active_model/naming.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb
index d86ef6224e..a9c62fc3a5 100644
--- a/activemodel/lib/active_model/naming.rb
+++ b/activemodel/lib/active_model/naming.rb
@@ -1,7 +1,7 @@
-require 'active_support/core_ext/hash/except'
-require 'active_support/core_ext/module/introspection'
-require 'active_support/core_ext/module/remove_method'
-require 'active_support/core_ext/module/delegation'
+require "active_support/core_ext/hash/except"
+require "active_support/core_ext/module/introspection"
+require "active_support/core_ext/module/remove_method"
+require "active_support/core_ext/module/delegation"
module ActiveModel
class Name
@@ -149,7 +149,7 @@ module ActiveModel
raise ArgumentError, "Class name cannot be blank. You need to supply a name argument when anonymous class given" if @name.blank?
- @unnamespaced = @name.sub(/^#{namespace.name}::/, '') if namespace
+ @unnamespaced = @name.sub(/^#{namespace.name}::/, "") if namespace
@klass = klass
@singular = _singularize(@name)
@plural = ActiveSupport::Inflector.pluralize(@singular)
@@ -192,7 +192,7 @@ module ActiveModel
private
def _singularize(string)
- ActiveSupport::Inflector.underscore(string).tr('/'.freeze, '_'.freeze)
+ ActiveSupport::Inflector.underscore(string).tr("/".freeze, "_".freeze)
end
end