lib/mongoid_geospatial/wrappers/georuby.rb in mongoid_geospatial-3.0.0 vs lib/mongoid_geospatial/wrappers/georuby.rb in mongoid_geospatial-3.1.0
- old
+ new
@@ -1,18 +1,18 @@
require 'geo_ruby'
-require 'mongoid_geospatial/extensions/georuby_point'
module Mongoid
module Geospatial
class Point
delegate :distance, :to => :to_geo
def to_geo
+ return unless valid?
GeoRuby::SimpleFeatures::Point.xy(x, y)
end
- def geo_distance other
+ def geo_distance(other)
to_geo.spherical_distance(other.to_geo)
end
end