I would like to execute a SQL statement and manipulate its resultset...
My SQL wont return data that fits on any model, I just would like to
do something like this:
sql = <<-ENDS
sum(a) AS F1,
min(b) AS F2
resultSet = ActiveRecord::Base.connection.execute(sql)
resultSet.each do |row|
logger.info "Field1: " + resultSet['F1']
logger.info "Field2: " + resultSet['F2']
I made this example up to show my idea, my real case is more
complicated, but I think I passed the idea here.
Thanks in advance