aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/initializable.rb2
-rw-r--r--railties/lib/rails/tasks/initializers.rake2
2 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/initializable.rb b/railties/lib/rails/initializable.rb
index 1a0b6d1e1a..085fbf64b2 100644
--- a/railties/lib/rails/initializable.rb
+++ b/railties/lib/rails/initializable.rb
@@ -9,6 +9,8 @@ module Rails
class Initializer
attr_reader :name, :block
+ delegate :railtie_name, to: :@context
+
def initialize(name, context, options, &block)
options[:group] ||= :default
@name, @context, @options, @block = name, context, options, block
diff --git a/railties/lib/rails/tasks/initializers.rake b/railties/lib/rails/tasks/initializers.rake
index 7e741bc5df..fd66b27bcd 100644
--- a/railties/lib/rails/tasks/initializers.rake
+++ b/railties/lib/rails/tasks/initializers.rake
@@ -1,6 +1,6 @@
desc "Print out all defined initializers in the order they are invoked by Rails."
task initializers: :environment do
Rails.application.initializers.tsort_each do |initializer|
- puts "#{initializer.instance_variable_get(:@context).class} #{initializer.name.inspect}"
+ puts "#{initializer.railtie_name}.#{initializer.name}"
end
end