Permalink
Browse files

Merge pull request #26951 from y-yagi/fix_ruby_warning

remove warning from railtie
  • Loading branch information...
guilleiguaran committed Nov 2, 2016
2 parents 9ebb355 + 34530f5 commit da23e125f8d755917b08f5cca1f7fe1ff38c8b7e
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/railtie.rb
@@ -194,7 +194,7 @@ def method_missing(name, *args, &block)
# `#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

0 comments on commit da23e12

Please sign in to comment.