diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-11-02 10:17:22 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-11-02 11:08:03 +0900 |
commit | 34530f5bd566be360be4030a38b898cba97bee85 (patch) | |
tree | 0b743ecf73b2c3e05070f959970e123e2cff12eb /railties/lib | |
parent | 9ebb3558f4bddc2af52829abd2b198bc7fab4a13 (diff) | |
download | rails-34530f5bd566be360be4030a38b898cba97bee85.tar.gz rails-34530f5bd566be360be4030a38b898cba97bee85.tar.bz2 rails-34530f5bd566be360be4030a38b898cba97bee85.zip |
remove warning from railtie
This removes the following warnings.
```ruby
rails/railties/lib/rails/railtie.rb:186: warning: instance variable @rake_tasks not initialized
rails/railties/lib/rails/railtie.rb:186: warning: instance variable @rake_tasks not initialized
rails/railties/lib/rails/railtie.rb:186: warning: instance variable @load_console not initialized
rails/railties/lib/rails/railtie.rb:186: warning: instance variable @rake_tasks not initialized
```
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/railtie.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index ae26501741..696db61f01 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -194,7 +194,7 @@ module Rails # `#each_registered_block(type, &block)` def register_block_for(type, &blk) var_name = "@#{type}" - blocks = instance_variable_get(var_name) || instance_variable_set(var_name, []) + blocks = instance_variable_defined?(var_name) ? instance_variable_get(var_name) : instance_variable_set(var_name, []) blocks << blk if blk blocks end |