Fix ActiveRecord 4.0 regression where using 'self' within a scope reverts to default scope.