Skip to content

Commit d85b3ec

Browse files
committed
Drop support for mongoid 5.
1 parent 5f41285 commit d85b3ec

11 files changed

+11
-335
lines changed

Diff for: .github/workflows/ci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ jobs:
77
strategy:
88
matrix:
99
entry:
10-
- { ruby: '2.6', mongodb: '4.4', mongoid: '5' }
11-
- { ruby: '3.2', mongodb: '6.0', mongoid: '5' }
1210
- { ruby: '2.7', mongodb: '4.4', mongoid: '6' }
1311
- { ruby: '2.7', mongodb: '4.4', mongoid: '7' }
1412
- { ruby: '3.0', mongodb: '4.4', mongoid: '6' }

Diff for: .rubocop_todo.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ Style/Documentation:
5151
Exclude:
5252
- 'spec/**/*'
5353
- 'test/**/*'
54-
- 'examples/mongoid_scroll_feed.rb'
55-
- 'lib/mongo/scrollable.rb'
54+
- 'examples/feed.rb'
5655
- 'lib/mongoid/criteria/scrollable.rb'
5756
- 'lib/mongoid/scroll/base_cursor.rb'
5857
- 'lib/mongoid/scroll/cursor.rb'

Diff for: CHANGELOG.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* [#38](https://github.com/mongoid/mongoid-scroll/pull/38): Add `previous_cursor` - [@GCorbel](https://github.com/GCorbel).
44
* [#42](https://github.com/mongoid/mongoid-scroll/pull/42): Add `first_cursor` - [@GCorbel](https://github.com/GCorbel).
55
* [#43](https://github.com/mongoid/mongoid-scroll/pull/43): Add `current_cursor` - [@GCorbel](https://github.com/GCorbel).
6+
* [#44](https://github.com/mongoid/mongoid-scroll/pull/44): Drop support for Mogoid 5 and Mongo Ruby Driver - [@dblock](https://github.com/dblock).
67
* Your contribution here.
78

89
### 1.0.1 (2023/03/15)
@@ -16,8 +17,8 @@
1617
* [#29](https://github.com/mongoid/mongoid-scroll/pull/29): Add ability to include the current record to the cursor - [@FabienChaynes](https://github.com/FabienChaynes).
1718
* [#30](https://github.com/mongoid/mongoid-scroll/pull/30): Prevent discrepancy between the original sort and the cursor sort - [@FabienChaynes](https://github.com/FabienChaynes).
1819
* [#32](https://github.com/mongoid/mongoid-scroll/pull/32): Add Base64 serialization for cursors - [@FabienChaynes](https://github.com/FabienChaynes).
19-
* [#33](https://github.com/mongoid/mongoid-scroll/pull/33): Removed support for Mongoid 3, 4 and Moped - [@dblock](https://github.com/dblock).
20-
* [#34](https://github.com/mongoid/mongoid-scroll/pull/34): Added support for Mongoid 8 - [@dblock](https://github.com/dblock).
20+
* [#33](https://github.com/mongoid/mongoid-scroll/pull/33): Remove support for Mongoid 3, 4 and Moped - [@dblock](https://github.com/dblock).
21+
* [#34](https://github.com/mongoid/mongoid-scroll/pull/34): Add support for Mongoid 8 - [@dblock](https://github.com/dblock).
2122

2223
### 0.3.7 (2021/06/01)
2324

@@ -32,7 +33,7 @@
3233
### 0.3.5 (2016/09/27)
3334

3435
* [#11](https://github.com/mongoid/mongoid-scroll/pull/11): Compatibility with Mongoid 6 - [@dblock](https://github.com/dblock).
35-
* [#12](https://github.com/mongoid/mongoid-scroll/pull/12): Added Danger, PR linter - [@dblock](https://github.com/dblock).
36+
* [#12](https://github.com/mongoid/mongoid-scroll/pull/12): Add Danger, PR linter - [@dblock](https://github.com/dblock).
3637

3738
### 0.3.4 (2015/10/22)
3839

@@ -55,15 +56,15 @@
5556
### 0.3.0 (2014/1/7)
5657

5758
* Compatibility with Mongoid 4.x - [@dblock](https://github.com/dblock).
58-
* Implemeneted Rubocop, Ruby linter - [@dblock](https://github.com/dblock).
59+
* Implemenet Rubocop, Ruby linter - [@dblock](https://github.com/dblock).
5960

6061
### 0.2.1 (2013/3/21)
6162

6263
* Fix: scroll over a collection that has duplicate values while data is being modified in a way that causes a change in the natural sort order - [@dblock](https://github.com/dblock).
6364

6465
### 0.2.0 (2013/3/14)
6566

66-
* Extended `Moped::Query` with `scroll` - [@dblock](https://github.com/dblock).
67+
* Extend `Moped::Query` with `scroll` - [@dblock](https://github.com/dblock).
6768
* `Mongoid::Scroll::Cursor.from_record` can now be called with either a Mongoid field or `field_type` and `field_name` in the `options` hash - [@dblock](https://github.com/dblock).
6869

6970
### 0.1.0 (2013/2/14)

Diff for: Gemfile

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ when 'HEAD' then gem 'mongoid', github: 'mongodb/mongoid'
77
when /8/ then gem 'mongoid', '~> 8.0'
88
when /7/ then gem 'mongoid', '~> 7.0'
99
when /6/ then gem 'mongoid', '~> 6.0'
10-
when /5/ then
11-
gem 'bigdecimal', '1.3.5'
12-
gem 'mongoid', '~> 5.0'
1310
else gem 'mongoid', version
1411
end
1512

Diff for: README.md

+3-28
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
- [The Problem](#the-problem)
55
- [Installation](#installation)
66
- [Usage](#usage)
7-
- [Mongoid](#mongoid)
8-
- [Mongo-Ruby-Driver (Mongoid 5)](#mongo-ruby-driver-mongoid-5)
97
- [Indexes and Performance](#indexes-and-performance)
108
- [Cursors](#cursors)
119
- [Standard Cursor](#standard-cursor)
@@ -24,13 +22,13 @@ Mongoid extension that enables infinite scrolling for `Mongoid::Criteria` and `M
2422

2523
## Compatibility
2624

27-
This gem supports Mongoid 5, 6, 7 and 8.
25+
This gem supports Mongoid 6, 7 and 8.
2826

2927
## Demo
3028

3129
Check out [shows on artsy.net](http://artsy.net/shows). Keep scrolling down.
3230

33-
There're also two code samples for Mongoid in [examples](examples). Run `bundle exec ruby examples/mongoid_scroll_feed.rb`.
31+
There're also two code samples for Mongoid in [examples](examples). Run `bundle exec ruby examples/feed.rb`.
3432

3533
## The Problem
3634

@@ -51,8 +49,6 @@ gem 'mongoid-scroll'
5149

5250
## Usage
5351

54-
### Mongoid
55-
5652
A sample model.
5753

5854
```ruby
@@ -106,27 +102,6 @@ Feed::Item.desc(:position).limit(5).scroll(saved_iterator.next_cursor) do |recor
106102
end
107103
```
108104

109-
### Mongo-Ruby-Driver (Mongoid 5)
110-
111-
Scroll a `Mongo::Collection::View` and save a cursor to the last item. You must also supply a `field_type` of the sort criteria.
112-
113-
```ruby
114-
saved_iterator = nil
115-
client[:feed_items].find.sort(position: -1).limit(5).scroll(nil, { field_type: DateTime }) do |record, iterator|
116-
# each record, one-by-one
117-
saved_iterator = iterator
118-
end
119-
```
120-
121-
Resume iterating using the previously saved cursor.
122-
123-
```ruby
124-
session[:feed_items].find.sort(position: -1).limit(5).scroll(saved_iterator.next_cursor, { field_type: DateTime }) do |record, iterator|
125-
# each record, one-by-one
126-
saved_iterator = iterator
127-
end
128-
```
129-
130105
## Indexes and Performance
131106

132107
A query without a cursor is identical to a query without a scroll.
@@ -212,4 +187,4 @@ Fork the project. Make your feature addition or bug fix with tests. Send a pull
212187

213188
MIT License, see [LICENSE](http://github.com/mongoid/mongoid-scroll/raw/master/LICENSE.md) for details.
214189

215-
(c) 2013-2023 [Daniel Doubrovkine](http://github.com/dblock), based on code by [Frank Macreery](http://github.com/macreery), [Artsy Inc.](http://artsy.net)
190+
(c) 2013-2024 [Daniel Doubrovkine](http://github.com/dblock), based on code by [Frank Macreery](http://github.com/macreery), [Artsy Inc.](http://artsy.net)
File renamed without changes.

Diff for: examples/mongo_ruby_driver_scroll_feed.rb

-45
This file was deleted.

Diff for: lib/mongo/scrollable.rb

-62
This file was deleted.

Diff for: lib/mongoid-scroll.rb

-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@
1212
require 'mongoid/criteria/scrollable/fields'
1313
require 'mongoid/criteria/scrollable/cursors'
1414
require 'mongoid/criteria/scrollable/iterator'
15-
require 'mongo/scrollable' if Object.const_defined?(:Mongo)
1615
require 'mongoid/criteria/scrollable'

Diff for: mongoid-scroll.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
1313
s.homepage = 'http://github.com/mongoid/mongoid-scroll'
1414
s.licenses = ['MIT']
1515
s.summary = 'Mongoid extensions to enable infinite scroll.'
16-
s.add_dependency 'mongoid', '>= 3.0'
16+
s.add_dependency 'mongoid', '>= 6.0'
1717
s.add_dependency 'mongoid-compatibility'
1818
s.add_dependency 'i18n'
1919
end

0 commit comments

Comments
 (0)