mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix unstated usage of inflector
This commit is contained in:
parent
fc0882ba5a
commit
8bb162f008
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue