for candidate scopes implemented by sql, replace them using AR pattern