-
14
Apr
So, this was a pain: I spent about 2 hours this weekend trying to find an easy way to execute a SQL select statement while circumventing the ActiveRecord model. After scouring the web and some old code, I found this:
Model.connection.select_rows(sql)
It returns an array of arrays, each inner array representing a record of data. Easy to do, and the results are easy to deal with.
- Published by James in: Programming
- If you like this blog please take a second from your precious time and subscribe to my rss feed!
Leave a Reply