Fix db after updating rails

All scopes and factories must be in lambdas and blocks