diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/initializable.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/tasks/initializers.rake | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/railties/lib/rails/initializable.rb b/railties/lib/rails/initializable.rb index 085fbf64b2..292379e3f3 100644 --- a/railties/lib/rails/initializable.rb +++ b/railties/lib/rails/initializable.rb @@ -9,8 +9,6 @@ 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 @@ -36,6 +34,10 @@ module Rails return self if @context Initializer.new(@name, context, @options, &block) end + + def context_class + @context.class + end end class Collection < Array diff --git a/railties/lib/rails/tasks/initializers.rake b/railties/lib/rails/tasks/initializers.rake index fd66b27bcd..6522f2ae5a 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.railtie_name}.#{initializer.name}" + puts "#{initializer.context_class}.#{initializer.name}" end end |