On Tuesday, September 22, 2015 at 1:31:24 PM UTC-7, Dale Ackerman wrote:
>
> Hi I have a API application that is serving up JSON it has a combination 
> models and more complex plain SQL like  DB['SELECT * ...']  how can I call a
>
> DB['SELECT * ...'].all.to_xml on the resultset?
>

You currently can't, as xml_serializer is a model plugin, not a dataset 
extension.  There is a fairly simple workaround:

c = Class.new(Sequel::Model)
c.plugin :xml_serializer
c.dataset = DB['SELECT * ...']
c.all.to_xml

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to