Skip to content

Instantly share code, notes, and snippets.

@zackham
Created December 7, 2011 17:33
Show Gist options
  • Save zackham/1443714 to your computer and use it in GitHub Desktop.
Save zackham/1443714 to your computer and use it in GitHub Desktop.
ruby-1.9.2-p290 :001 > a = Route.find 309908
=> #<Route id: 309908, group_membership_id: 35, name: "test", description: "", created_at: "2011-12-07 17:29:45", distance: 3220.55, elevation_gain: 38.656, elevation_loss: 210.293, visibility: 0, first_lat: 44.003060000000005, first_lng: -123.10965000000002, last_lat: 44.00095, last_lng: -123.09212000000001, secret_key: nil, bad_elevations: false, is_trip: false, postal_code: "97405", locality: "Eugene", administrative_area: "Oregon", has_histogram_image: false, pavement_type_id: nil, country_code: "US", average_rating: 0.0, category_id: 0>
ruby-1.9.2-p290 :002 > a.course_points
=> [{"x"=>-123.09956999999997, "y"=>43.99689, "t"=>"Left", "n"=>"Skarpt til venstre og inn på Willamette St", "d"=>1558.2270196996717, "i"=>45}, {"x"=>-123.09476000000001, "y"=>44.00251, "t"=>"Right", "n"=>"Sving til høyre og inn på Coachman Dr", "d"=>2319.6279202483624, "i"=>-1}, {"x"=>-123.0924, "y"=>44.00288, "t"=>"Right", "n"=>"Ta til høyre mot E 49th Ave", "d"=>2561.46875989974, "i"=>89}, {"x"=>-123.09163999999998, "y"=>44.00336, "t"=>"Right", "n"=>"Sving til høyre og inn på E 49th Ave", "d"=>2642.4525533428578, "i"=>92}, {"x"=>-123.08988999999997, "y"=>44.00312, "t"=>"Right", "n"=>"Sving til høyre og inn på Donald St", "d"=>2791.013780653592, "i"=>100}, {"x"=>-123.09055999999998, "y"=>44.00058000000001, "t"=>"Right", "n"=>"Sving til høyre og inn på Ventura Ave", "d"=>3084.1878589167495, "i"=>116}]
ruby-1.9.2-p290 :003 > a.course_points = [{"x"=>-123.09956999999997, "y"=>43.99689, "t"=>"Left", "n"=>"Updated!!", "d"=>1558.2270196996717, "i"=>45}]
=> [{"x"=>-123.09956999999997, "y"=>43.99689, "t"=>"Left", "n"=>"Updated!!", "d"=>1558.2270196996717, "i"=>45}]
ruby-1.9.2-p290 :004 > a.save
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment