I need to pull data from a legacy SQL Server database and turn it into JSON. I have SQL queries already written (for legacy versions of reports, that I'm replacing) that extracts exactly what I need.
It is of course easy to turn ActiveRecord objects to JSON (and CSV), but I don't see any good way to do what I need to do, since all the ActiveRecord methods involving raw SQL seem to be aimed at returning ActiveRecord objects, and this data doesn't necessarily logically correspond to a class, and I don't need to persist it anywhere additional. I just want to perform the SQL query and return JSON and CSV and be done with it.