Rails: Issuing direct query to database

By bansalakhil June 18, 2006

Issue direct query to database by:

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

Share this:

Leave a comment

Your email address will not be published. Required fields are marked *