def records_for(query)
#      STDERR.puts "records_for(#{query})"
#      STDERR.puts "records_for(#{query.inspect})"
      records = []
      if query.conditions.nil?
	raise "query.conditions.nil?" # FIXME
      else
	query.conditions.operands.each do |operand|
	  if operand.is_a?(DataMapper::Query::Conditions::OrOperation)
	    operand.each do |op|
	      records = records + perform_query(query, op)
	    end
	  else
	    records = perform_query(query, operand)
	  end
	end
      end      
      records
    end
def records_for(query)
#      STDERR.puts "records_for(#{query})"
#      STDERR.puts "records_for(#{query.inspect})"
      records = []
      if query.conditions.nil?
	raise "query.conditions.nil?" # FIXME
      else
	query.conditions.operands.each do |operand|
	  if operand.is_a?(DataMapper::Query::Conditions::OrOperation)
	    operand.each do |op|
	      records = records + perform_query(query, op)
	    end
	  else
	    records = perform_query(query, operand)
	  end
	end
      end      
      records
    end
taken from https://github.com/whoahbot/dm-redis-adapter/