Skip to content
Snippets Groups Projects
Commit a2813ba6 authored by Christian Gambardella's avatar Christian Gambardella
Browse files

Update lib/geocoder/models/mongoid.rb

Doesnt crash if ::Mongoid::VERSION isn't defined.
It does fall back to Mongoid version < 3
parent 16fd4bad
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ module Geocoder ...@@ -18,7 +18,7 @@ module Geocoder
super(options) super(options)
if options[:skip_index] == false if options[:skip_index] == false
# create 2d index # create 2d index
if (::Mongoid::VERSION >= "3") if (defined? ::Mongoid::VERSION && ::Mongoid::VERSION >= "3")
index({ geocoder_options[:coordinates].to_sym => '2d' }, index({ geocoder_options[:coordinates].to_sym => '2d' },
{:min => -180, :max => 180}) {:min => -180, :max => 180})
else else
......
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