Issue direct query to database by:

result = ‘’ActiveRecord::Base.connection.execute(”SELECT * from tablename;”).each do |row| result += “#{row},” end

Share this: