Rails 4?
Closed this issue · 4 comments
nielsen commented
Is there any plan for Rails 4 support?
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
mongoid_geospatial (>= 0) ruby depends on
activemodel (~> 3.1) ruby
rails (= 4.0.0) ruby depends on
activemodel (4.0.0)
unkleara commented
I am currently trying it out with Rails 4 and Mongoid 4.
Try adding following to gemfile:
gem 'mongoid_geospatial', github: 'nofxx/mongoid_geospatial', branch: 'master'
nofxx commented
Created a new gem version. 2.8.3
Lots of changes to be coming with mongoid 4 and mongodb new features!
unkleara commented
Great. Was trying it out for following type queries. Will come in handy once I get familiar with mongodb geospatial stuff.
Van.where({:'origin.coordinates' => {"$within" => {"$centerSphere" => [origin, (origin_radius.fdiv(3959))]}}, '$and' => [{:'destination.states'.in => [state]}, "$or" => {:'destination.coordinates' => {"$within" => {"$centerSphere" => [dest, (dest_radius.fdiv(3959))]}}}]})
It works for now though.
edit: actually "$or" doesn't work with mongodb geospatial queries
http://docs.mongodb.org/manual/reference/operator/query/or/
oh well.