diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2016-11-01 23:26:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-01 23:26:08 -0500 |
commit | da23e125f8d755917b08f5cca1f7fe1ff38c8b7e (patch) | |
tree | 0b743ecf73b2c3e05070f959970e123e2cff12eb /railties/lib | |
parent | 9ebb3558f4bddc2af52829abd2b198bc7fab4a13 (diff) | |
parent | 34530f5bd566be360be4030a38b898cba97bee85 (diff) | |
download | rails-da23e125f8d755917b08f5cca1f7fe1ff38c8b7e.tar.gz rails-da23e125f8d755917b08f5cca1f7fe1ff38c8b7e.tar.bz2 rails-da23e125f8d755917b08f5cca1f7fe1ff38c8b7e.zip |
Merge pull request #26951 from y-yagi/fix_ruby_warning
remove warning from railtie
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 |