Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix unstated usage of inflector

  • Loading branch information...
commit 8bb162f008bb8e3a66b4a0d98b9f56cad45a4ab3 1 parent fc0882b
@jeremy jeremy authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 railties/lib/rails/railtie.rb
View
8 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 @@ def inherited(base)
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 @@ def generators(&blk)
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
Please sign in to comment.
Something went wrong with that request. Please try again.