Rails: Issuing direct query to database

Published on Author Akhil Bansal1 Comment

You can issue direct query to database by:

result = ActiveRecord::Base.connection.execute("SELECT * from tablename")

and fetch hash:

a=result.fetch_hash

One Response to Rails: Issuing direct query to database

  1. long time lurker he.e..rdoes Fumie go for natto? Do you? That is my favorite Japanese food, bar none.And enforced duck breast dinners with red cabbage doesn't sound so bad…

Leave a Reply

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