I think the only way to get this to work is by directly executing the request.
ActiveRecord::Base.connection.execute("SELECT REPEAT('a',1) UNION SELECT REPEAT('b',10)")
This returns an ActiveRecord result set. If you want the results wrapped in a model to do something like this:
MyModel.find_by_sql("...")
Dan fox
source share