aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/naming.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-03-26 11:34:01 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-03-26 11:34:01 -0700
commit65f4d8019f63ff384b0ecfe25b6f5f829151de9a (patch)
treeeb601399ccec237d74342b62d9d152a66969a138 /activemodel/lib/active_model/naming.rb
parent6289f455ae6c6d01aef34e46589e1d78c6f78190 (diff)
downloadrails-65f4d8019f63ff384b0ecfe25b6f5f829151de9a.tar.gz
rails-65f4d8019f63ff384b0ecfe25b6f5f829151de9a.tar.bz2
rails-65f4d8019f63ff384b0ecfe25b6f5f829151de9a.zip
no need to freeze things all the time
Diffstat (limited to 'activemodel/lib/active_model/naming.rb')
-rw-r--r--activemodel/lib/active_model/naming.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb
index a7ebf098a4..adf000e53c 100644
--- a/activemodel/lib/active_model/naming.rb
+++ b/activemodel/lib/active_model/naming.rb
@@ -25,18 +25,17 @@ module ActiveModel
@unnamespaced = @name.sub(/^#{namespace.name}::/, '') if namespace
@klass = klass
- @singular = _singularize(@name).freeze
- @plural = ActiveSupport::Inflector.pluralize(@singular).freeze
- @element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(@name)).freeze
- @human = ActiveSupport::Inflector.humanize(@element).freeze
- @collection = ActiveSupport::Inflector.tableize(@name).freeze
- @param_key = (namespace ? _singularize(@unnamespaced) : @singular).freeze
+ @singular = _singularize(@name)
+ @plural = ActiveSupport::Inflector.pluralize(@singular)
+ @element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(@name))
+ @human = ActiveSupport::Inflector.humanize(@element)
+ @collection = ActiveSupport::Inflector.tableize(@name)
+ @param_key = (namespace ? _singularize(@unnamespaced) : @singular)
@i18n_key = @name.underscore.to_sym
@route_key = (namespace ? ActiveSupport::Inflector.pluralize(@param_key) : @plural.dup)
- @singular_route_key = ActiveSupport::Inflector.singularize(@route_key).freeze
+ @singular_route_key = ActiveSupport::Inflector.singularize(@route_key)
@route_key << "_index" if @plural == @singular
- @route_key.freeze
end
# Transform the model name into a more humane format, using I18n. By default,