On Sunday, May 14, 2017 at 6:16:58 AM UTC-7, Mark Cyzyk wrote:
>
> I have a dataset ("results") and I want to output it as CSV to a file 
> ("output.csv").  Trying to use the Sequel CSV Serializer plugin for this, 
> but a ".to_csv" method is never being attached to my dataset:
>
> results = DBLookupAndResults[:results]
> results.plugin :csv_serializer
> File.open('output.csv', 'w'){|file|
>   file << results.to_csv
> }
>
> Not sure what to do.  So close to getting this to work!
>
> Mark
>

Plugins are model level, not dataset level. You should be getting a 
NoMethodError when you call plugin on a dataset.

You can probably use the csv library directly, or a helper like enum_csv if 
you want to convert a dataset to csv.

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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to