Try:
```ruby
  def score_points(options = {})
    scope = sash.scores.includes(:score_points)
    if (category = options[:category])
      scope = scope.where('merit_scores.category = ?', category)
    end
    scope
  end
```