diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-03-01 18:52:07 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-03-01 18:52:07 -0800 |
commit | 8bb162f008bb8e3a66b4a0d98b9f56cad45a4ab3 (patch) | |
tree | b7f47070a4e46db95ef098ef0d8ed0b7169aa513 | |
parent | fc0882ba5a0f18281736859718252042b15614ad (diff) | |
download | rails-8bb162f008bb8e3a66b4a0d98b9f56cad45a4ab3.tar.gz rails-8bb162f008bb8e3a66b4a0d98b9f56cad45a4ab3.tar.bz2 rails-8bb162f008bb8e3a66b4a0d98b9f56cad45a4ab3.zip |
Fix unstated usage of inflector
-rw-r--r-- | railties/lib/rails/railtie.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index 67afae5862..37c802fb60 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -1,5 +1,6 @@ require 'rails/initializable' require 'rails/configuration' +require 'active_support/inflector' module Rails class Railtie @@ -23,9 +24,8 @@ module Rails end def railtie_name(railtie_name = nil) - @railtie_name ||= name.demodulize.underscore @railtie_name = railtie_name if railtie_name - @railtie_name + @railtie_name ||= default_name end def railtie_names @@ -53,6 +53,10 @@ module Rails def abstract_railtie?(base) ABSTRACT_RAILTIES.include?(base.name) end + + def default_name + ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(name)) + end end def rake_tasks |