Swathi K
Swathi K

Reputation: 276

uninitialized constant Mongoid::Spacial::Document::ClassMethods::Mongo

I am trying to use mongoid_spacial gem and here is how my model looks:

class Place
    include Mongoid::Document
    include Mongoid::Spacial::Document

        field :name, :type => String

        field :source,            type: Array,    spacial: true
        field :mouth,             type: Array,    spacial: {lat: :latitude, lng: :longitude,    return_array: true }

       spacial_index :source

      end

The error is

   uninitialized constant Mongoid::Spacial::Document::ClassMethods::Mongo
   MONGOID: Attempted to constantize Property, trying without namespacing.
   MONGOID: Failed to determine model from app/models/property.rb:
   NameError:uninitialized constant Mongoid::Spacial::Document::ClassMethods::Mongo`

Any help is appreciated.

Upvotes: 0

Views: 538

Answers (1)

kynan
kynan

Reputation: 13613

Upgrade to mongoid_spacial 0.2.17, which fixes a namespacing bug you're seeing.

Upvotes: 1

Related Questions