aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/lib/rails/railtie.rb8
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