Skip to content

fix bug in memorize of subject in its method

gitlab-qa-bot requested to merge github/fork/masarakki/master into master

Created by: masarakki

i found a bug in its method.

define_method(:subject) do @_subject ||= some_method end

can't memory if some_method return false or nil. so fix to use instance_variable_defined? instead of ||=

its simple code for testing it https://gist.github.com/2050346

Merge request reports