Fix merge error when Equality LHS is non-attribute.

This is reworking of rails/rails/pull/7380 made for rails 3.