mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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 ```
This commit is contained in:
parent
9ebb3558f4
commit
34530f5bd5
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue