I am using activerecord
and find_by_sql
to output the results of the sql query:
S = Object.find_by_sql("SELECT * FROM foo")
S.each do |s|
puts "#{s}"
end
I get
#<Object:0x0000010214d5e0>
#<Object:0x0000010214ce60>
etc...
I need the actual results.
Thanks in advance
Mark
If you want just the raw unprocessed data from an arbitrary SQL query, you should be using
select_rows
thusly:You'll have to sort out type conversions and such yourself but sometimes all the ActiveRecord machinery just gets in the way so you can work with raw SQL and results as needed.