DhruvaSagar
unread,Jun 3, 2011, 12:01:21 AM6/3/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongoid-geo
ruby-1.9.2-p180 :031 > Person.geoNear([45, -3, 10], :pos)
NoMethodError: undefined method `from_point=' for #<Person:
0x000000023a0938>
from /home/dhruva/.rvm/gems/ruby-1.9.2-p180/gems/mongoid-2.0.2/lib/
mongoid/attributes.rb:162:in `method_missing'
from /home/dhruva/.rvm/gems/ruby-1.9.2-p180/gems/mongoid_geo-0.6.1/
lib/mongoid/geo/near.rb:71:in `block in query_result'
from /home/dhruva/.rvm/gems/ruby-1.9.2-p180/gems/mongoid_geo-0.6.1/
lib/mongoid/geo/near.rb:67:in `map'
from /home/dhruva/.rvm/gems/ruby-1.9.2-p180/gems/mongoid_geo-0.6.1/
lib/mongoid/geo/near.rb:67:in `query_result'
from /home/dhruva/.rvm/gems/ruby-1.9.2-p180/gems/mongoid_geo-0.6.1/
lib/mongoid/geo/near.rb:34:in `geoNear'
from (irb):31
from /home/dhruva/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/
rails/commands/console.rb:44:in `start'
from /home/dhruva/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/
rails/commands/console.rb:8:in `start'
from /home/dhruva/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/
rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Here is my Model :
class Person
include Mongoid::Document
extend Mongoid::Geo::Near
field :location, :type => Array, :geo => true
geo_index :location
end