aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/plugin.rb4
-rw-r--r--railties/lib/rails/railtie.rb7
2 files changed, 11 insertions, 0 deletions
diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb
index 22a0eb10a8..c07ff2f9cf 100644
--- a/railties/lib/rails/plugin.rb
+++ b/railties/lib/rails/plugin.rb
@@ -48,6 +48,10 @@ module Rails
attr_reader :name, :path
+ def railtie_name
+ name.to_s
+ end
+
def load_tasks
super
load_deprecated_tasks
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb
index 0514e425fd..3e2a3c5231 100644
--- a/railties/lib/rails/railtie.rb
+++ b/railties/lib/rails/railtie.rb
@@ -164,8 +164,15 @@ module Rails
def abstract_railtie?
ABSTRACT_RAILTIES.include?(name)
end
+
+ def railtie_name(name = nil)
+ @railtie_name = name if name
+ @railtie_name ||= ActiveSupport::Inflector.underscore(self.name).gsub("/", "_")
+ end
end
+ delegate :railtie_name, :to => "self.class"
+
def config
@config ||= Railtie::Configuration.new
end