Thanks Jeremy, ah that was something I was interested in (GroupSet#route
method).. works wonderfully!
Adam
On Sunday, 15 September 2013 01:40:09 UTC+1, Jeremy Evans wrote:
>
> On Saturday, September 14, 2013 10:21:36 AM UTC-7, Adam Gamble wrote:
>
>> OK, forgive the awful code -- still not comfortable writing Ruby as i'm
>> mostly a JavaScript guy. I can get a result with...
>>
>>
>> 1. puts GroupSet.all().collect {|item|
>> 2. route = Child.filter(:group_set_id => item.id).collect {|o|
>> 3. [o.lat, o.lng]
>> 4. }
>> 5.
>> 6. {:id => item.id, :route => route}
>> 7. }.to_json()
>>
>>
>>
>> For context see my pastebin here: http://pastebin.com/j7Qnk1dv
>>
>> Is this a reasonable approach? Feel my knowledge is lacking :/
>>
>
> That's a reasonable approach. You should also be able to get this to work
> using GroupSet#to_json, but you would need to define a GroupSet#route
> method that returned the lat and lng pairs, and use the :only=>[:title,
> :route] option.
>
> 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/groups/opt_out.