active record scopes, without rails