Jeremy Evans wrote:
> FYI, a Sequel dataset is an abstract representation of an SQL query, it 
> doesn't contain any records itself.  Assuming that Array#to_json works 
> correctly, you could define:
> 
>   class Sequel::Dataset
>     def to_json
>       all.to_json
>     end
>   end
> 
> and then call to_json on a dataset to get the query results in JSON 
> format.

Thanks for that.  A couple of problems I still have though:

1. I tried:
   ...
   Task.all.to_json
   ...
and ".all" still returned an array of object references without the 
actual values, like this:

["#<Task:0x42527b4>","#<Task:0x4251800>","#<Task:0x425084c>","#<Task:0x424f898>","#<Task:0x424e8e4>","#<Task:0x424d930>","#<Task:0x424c97c>"]

2. Once that's working, where should I put this code:
>    class Sequel::Dataset
>     def to_json
>       all.to_json
>     end
>   end
Can you point me in the direction of any useful reading material?

Thanks in advance,

Phil
-- 
Posted via http://www.ruby-forum.com/.