mongoid_spacial 0.2.2 → 0.2.3

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -24,8 +24,10 @@ module Mongoid #:nodoc:
24
24
  query = {"$#{operator}" => v[:point] }
25
25
  if v[:max]
26
26
  if unit = Mongoid::Spacial.earth_radius[v[:unit]]
27
- unit = (operator =~ /sphere/i) ? unit : unit * Mongoid::Spacial::RAD_PER_DEG
27
+ unit *= Mongoid::Spacial::RAD_PER_DEG unless operator =~ /sphere/i
28
28
  query['$maxDistance'] = v[:max]/unit
29
+ else
30
+ query['$maxDistance'] = v[:max]
29
31
  end
30
32
  end
31
33
  query
@@ -33,7 +33,7 @@ module Mongoid #:nodoc:
33
33
  input[:point] = input[:point].to_lng_lat if input[:point].respond_to?(:to_lng_lat)
34
34
  if input[:max]
35
35
  if unit = Mongoid::Spacial.earth_radius[input[:unit]]
36
- unit = (operator =~ /sphere/i) ? unit : unit * Mongoid::Spacial::RAD_PER_DEG
36
+ unit *= Mongoid::Spacial::RAD_PER_DEG unless operator =~ /sphere/i
37
37
  input[:max] = input[:max]/unit
38
38
  end
39
39
  input = [input[:point],input[:max]]
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongoid_spacial}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Ryan Ong}]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mongoid_spacial
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.2
5
+ version: 0.2.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ryan Ong
@@ -262,7 +262,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
262
262
  requirements:
263
263
  - - ">="
264
264
  - !ruby/object:Gem::Version
265
- hash: -35115700109095116
265
+ hash: -1587512017172586641
266
266
  segments:
267
267
  - 0
268
268
  version: "0"