Module: Mongoid::Location::ClassMethods
- Defined in:
- lib/mongoid_location/location.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#spatial_index(name, options = {}) ⇒ Object
create spatial index for given field.
Instance Method Details
#spatial_index(name, options = {}) ⇒ Object
create spatial index for given field
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/mongoid_location/location.rb', line 55 def spatial_index name, = {} self.spatial_fields_indexed << name # fix 3.x version if Mongoid::VERSION =~ /^3.\d/ #if Mongoid::VERSION =~ /3.0/ index({name => '2d'}, ) else index [[name, '2d']], end end |