diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-07-26 17:05:04 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-03 22:59:08 +0200 |
commit | bfccbc6df91a3c24bbf99262383c6f1e9069e1dd (patch) | |
tree | a80e581455818aa3e18ae496cc65549d56013944 /actionpack/lib/action_dispatch | |
parent | b52dfc6726d6471b5fea4ef1bde988157002a224 (diff) | |
download | rails-bfccbc6df91a3c24bbf99262383c6f1e9069e1dd.tar.gz rails-bfccbc6df91a3c24bbf99262383c6f1e9069e1dd.tar.bz2 rails-bfccbc6df91a3c24bbf99262383c6f1e9069e1dd.zip |
Add Rails::Railtie.railtie_name method to allow setting custom name for railtie
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index ef1bee106a..b437d7a17d 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -277,8 +277,13 @@ module ActionDispatch private def app_name(app) return unless app.respond_to?(:routes) - class_name = app.class.is_a?(Class) ? app.name : app.class.name - ActiveSupport::Inflector.underscore(class_name).gsub("/", "_") + + if app.respond_to?(:railtie_name) + app.railtie_name + else + class_name = app.class.is_a?(Class) ? app.name : app.class.name + ActiveSupport::Inflector.underscore(class_name).gsub("/", "_") + end end def define_generate_prefix(app, name) |