Skip to content

Commit

Permalink
Merge pull request mongoid#59 from dblock/mongoid-5-6
Browse files Browse the repository at this point in the history
Test against multiple versions of mongoid, fix for mongoid 6.
  • Loading branch information
dblock authored Jul 12, 2017
2 parents 4093de0 + c6e7e7c commit 9d25a5a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ addons:
- mongodb-3.2-precise
packages:
- mongodb-org-server

env:
- MONGOID_VERSION=5
- MONGOID_VERSION=6
- MONGOID_VERSION=HEAD

matrix:
allow_failures:
- env: MONGOID_VERSION=HEAD
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 5.1.0 (Next)

* [#59](https://github.com/mongoid/mongoid-geospatial/pull/59): Test against Mongoid 5 and 6 - [@dblock](https://github.com/dblock).
* [#52](https://github.com/mongoid/mongoid-geospatial/pull/52): Added Danger and Rubocop, PR and code linters - [@dblock](https://github.com/dblock).
* Your contribution here.

Expand Down
16 changes: 12 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
source 'http://rubygems.org'

gem 'mongoid', '>=5.0.0'

gemspec # Specify gem's dependencies in mongoid_geospatial.gemspec
case version = ENV['MONGOID_VERSION'] || '6'
when 'HEAD'
gem 'mongoid', github: 'mongodb/mongoid'
when /^6/
gem 'mongoid', '~> 6.0.0'
when /^5/
gem 'mongoid', '~> 5.0'
else
gem 'mongoid', version
end

gem 'rake'
gemspec

group :development, :test do
gem 'rake'
gem 'pry'
gem 'yard'
gem 'fuubar'
Expand Down
2 changes: 1 addition & 1 deletion MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2009-2016 Mongoid Geospatial Authors
Copyright (c) 2009-2017 Mongoid Geospatial Authors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ A Mongoid Extension that simplifies the use of MongoDB spatial features.
Quick Start
-----------

This gem focuses on (making helpers for) MongoDB's spatial features.
But you may also use an external Geometric/Spatial gem alongside.
This gem focuses on (making helpers for) MongoDB's spatial features using Mongoid 5 or 6.

```ruby
# Gemfile
gem 'mongoid-geospatial', require: 'mongoid/geospatial'
gem 'mongoid-geospatial'
```

Use version 5.x for Mongoid 5 and version 4.x for Mongoid 4.

A `Place` to illustrate `Point`, `Line` and `Polygon`

```ruby
Expand Down Expand Up @@ -60,7 +57,7 @@ rake db:mongoid:create_indexes

Or programatically:

```
```ruby
Place.create_indexes
```

Expand Down Expand Up @@ -398,7 +395,7 @@ Contributing
License
-------

Copyright (c) 2009-2015 Mongoid Geospatial Authors
Copyright (c) 2009-2017 Mongoid Geospatial Authors

MIT License, see [MIT-LICENSE](MIT-LICENSE).

2 changes: 0 additions & 2 deletions spec/models/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ def score_with_rescoring=(score)
self.score_without_rescoring = score
end

alias_method_chain :score=, :rescoring

def update_addresses
addresses.each do |address|
address.street = 'Updated Address'
Expand Down

0 comments on commit 9d25a5a

Please sign in to comment.