Don't use Active Record scopes

They have problems when defined in abstract base classes, see 
https://github.com/rails/rails/issues/10658

This replaces that scope with a plain class method.