Permalink
Browse files

Update lib/mongoid_geospatial/fields/polygon.rb

  • Loading branch information...
1 parent aed2e77 commit f53ac3d6872636416d4cadccc658ae40f22ae78f @larryvaughn71 larryvaughn71 committed May 8, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/mongoid_geospatial/fields/polygon.rb
@@ -2,17 +2,15 @@ module Mongoid
module Geospatial
class Polygon
- include Mongoid::Fields::Serializable
-
- def deserialize(object)
+ def mongoize(object)
points = object.map do |pair|
RGeo::Geographic.spherical_factory.point *pair
end
ring = RGeo::Geographic.spherical_factory.linear_ring points
RGeo::Geographic.spherical_factory.polygon ring
end
- def serialize(object)
+ def demongoize(object)
object #.flatten
end

0 comments on commit f53ac3d

Please sign in to comment.