def run_scope(scope, machine, klass, states)
      values = states.flatten.map { |state| machine.states.fetch(state).value }
      scope.call(klass, values)
    end
def run_scope(scope, machine, klass, states)
      values = states.flatten.map { |state| machine.states.fetch(state).value }
      scope.call(klass, values)
    end
Generates the results for the given scope based on one or more states to
 filter by