Skip to content
Snippets Groups Projects
Commit 10824dda authored by Alex Reisner's avatar Alex Reisner
Browse files

Don't try to exclude self if not yet persisted.

parent dab836f4
No related branches found
No related tags found
No related merge requests found
...@@ -62,7 +62,7 @@ module Geocoder ...@@ -62,7 +62,7 @@ module Geocoder
# #
def nearbys(radius = 20, options = {}) def nearbys(radius = 20, options = {})
return nil unless geocoded? return nil unless geocoded?
options.merge!(:exclude => self) options.merge!(:exclude => self) unless send(self.class.primary_key).nil?
self.class.near(self, radius, options) self.class.near(self, radius, options)
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment