Added scope for ratings db queries