Skip to content

Commit 9d25a5a

Browse files
authored
Merge pull request #59 from dblock/mongoid-5-6
Test against multiple versions of mongoid, fix for mongoid 6.
2 parents 4093de0 + c6e7e7c commit 9d25a5a

File tree

6 files changed

+27
-14
lines changed

6 files changed

+27
-14
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,12 @@ addons:
2121
- mongodb-3.2-precise
2222
packages:
2323
- mongodb-org-server
24+
25+
env:
26+
- MONGOID_VERSION=5
27+
- MONGOID_VERSION=6
28+
- MONGOID_VERSION=HEAD
29+
30+
matrix:
31+
allow_failures:
32+
- env: MONGOID_VERSION=HEAD

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 5.1.0 (Next)
22

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

Gemfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
source 'http://rubygems.org'
22

3-
gem 'mongoid', '>=5.0.0'
4-
5-
gemspec # Specify gem's dependencies in mongoid_geospatial.gemspec
3+
case version = ENV['MONGOID_VERSION'] || '6'
4+
when 'HEAD'
5+
gem 'mongoid', github: 'mongodb/mongoid'
6+
when /^6/
7+
gem 'mongoid', '~> 6.0.0'
8+
when /^5/
9+
gem 'mongoid', '~> 5.0'
10+
else
11+
gem 'mongoid', version
12+
end
613

7-
gem 'rake'
14+
gemspec
815

916
group :development, :test do
17+
gem 'rake'
1018
gem 'pry'
1119
gem 'yard'
1220
gem 'fuubar'

MIT-LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2009-2016 Mongoid Geospatial Authors
1+
Copyright (c) 2009-2017 Mongoid Geospatial Authors
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@ A Mongoid Extension that simplifies the use of MongoDB spatial features.
1212
Quick Start
1313
-----------
1414

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

1817
```ruby
1918
# Gemfile
20-
gem 'mongoid-geospatial', require: 'mongoid/geospatial'
19+
gem 'mongoid-geospatial'
2120
```
2221

23-
Use version 5.x for Mongoid 5 and version 4.x for Mongoid 4.
24-
2522
A `Place` to illustrate `Point`, `Line` and `Polygon`
2623

2724
```ruby
@@ -60,7 +57,7 @@ rake db:mongoid:create_indexes
6057

6158
Or programatically:
6259

63-
```
60+
```ruby
6461
Place.create_indexes
6562
```
6663

@@ -398,7 +395,7 @@ Contributing
398395
License
399396
-------
400397

401-
Copyright (c) 2009-2015 Mongoid Geospatial Authors
398+
Copyright (c) 2009-2017 Mongoid Geospatial Authors
402399

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

spec/models/person.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ def score_with_rescoring=(score)
6565
self.score_without_rescoring = score
6666
end
6767

68-
alias_method_chain :score=, :rescoring
69-
7068
def update_addresses
7169
addresses.each do |address|
7270
address.street = 'Updated Address'

0 commit comments

Comments
 (0)