fix regression for rails issue #9994

thanks to @dsabanin for reporting the regression and for creating
failing gist