converted db to pg, changed search params to named_scopes