diff options
author | ta1kt0me <p.wadachi@gmail.com> | 2016-06-11 00:28:14 +0900 |
---|---|---|
committer | ta1kt0me <p.wadachi@gmail.com> | 2016-06-11 00:29:32 +0900 |
commit | 116f7a18b2c58fb160978958c6c5f644a8da1dee (patch) | |
tree | e06b83152f4a079278f8d081f3fc43716cb0438c /railties/lib/rails | |
parent | e51eb806f60c8d6997a7fb038708dcc619a3eebf (diff) | |
download | rails-116f7a18b2c58fb160978958c6c5f644a8da1dee.tar.gz rails-116f7a18b2c58fb160978958c6c5f644a8da1dee.tar.bz2 rails-116f7a18b2c58fb160978958c6c5f644a8da1dee.zip |
Delegate public method for raitile name
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/initializable.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/tasks/initializers.rake | 2 |
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 |