mongoid-geospatial 7.3.1 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9437e8d6af695bcba5f39208f8219019da404fc51b863c4fb7940567183c5c9f
4
- data.tar.gz: 2a3ca5f675cd58c204462b7122b84341c63cee8222f3372a014d1ed3096f82f0
3
+ metadata.gz: 3fe8fdb16899dedfb2b332791e86caff0a6263e6a973ac9460e6b167f2540edb
4
+ data.tar.gz: 00a8663771fb673841e1addfcf7add390269982d1c1468f34cc77e73fda36428
5
5
  SHA512:
6
- metadata.gz: 82fe874fb74ab68457b2e9c56c202bd94ff6c71626832fa0a514d8ce7741282bff68d7c08601806c72e56bf4364d5173f3cdfdaca47b005c86f698f0601d9697
7
- data.tar.gz: fb2a788d4559688612083fddb24ef77d632d0d18b58aa5f3a6216ca58d6c6220a88180db3b009f4697fda2aa0cb95a43d3ef2d11ccc6e0d8a4f8003cc320227c
6
+ metadata.gz: 179a915b32d8a20386adefbcb040681b49c53139970a68a8965089b7117a67f456b70cd3b3266c4a224225d374bf2710679dc9125ea11e45c489b3cc0de2458d
7
+ data.tar.gz: 6390574b2c40e723b138824f2af1b98491c61d4b5aa87ae26bfd8dfa0407d93164cf6eb03897a278c939ae9db4f4b5d77a8f8861b1e963aa4bb5587c83316fbe
@@ -34,6 +34,19 @@ module Mongoid
34
34
  alias to_xy mongoize
35
35
  alias to_lng_lat mongoize
36
36
 
37
+ # Two points are the same spot when they hold the same pair. Without
38
+ # this, `==` was object identity (Enumerable does not bring one), so a
39
+ # point loaded twice never equalled itself: `place.geom == city.geom`
40
+ # was false for the very same [x, y]. Only a Point equals a Point —
41
+ # `to_a` is the door to compare with an Array. z is not stored (see
42
+ # #mongoize), so it does not take part.
43
+ def ==(other)
44
+ other.is_a?(Point) && mongoize == other.mongoize
45
+ end
46
+ alias eql? ==
47
+
48
+ def hash = [Point, mongoize].hash
49
+
37
50
  def [](args)
38
51
  raise ArgumentError, "Invalid point: #{inspect}" unless (pair = mongoize)
39
52
 
@@ -3,6 +3,6 @@
3
3
  module Mongoid
4
4
  # Mongoid Geospatial version
5
5
  module Geospatial
6
- VERSION = '7.3.1'
6
+ VERSION = '7.4.0'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-geospatial
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.1
4
+ version: 7.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Ong