Skip to content

Commit

Permalink
deps: bump mongoid-scroll to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
markokajzer committed Dec 2, 2024
1 parent bd3e97c commit 99e60f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Your contribution here.
* [#175](https://github.com/slack-ruby/slack-ruby-bot-server/pull/175): Fix(activerecord): correctly check for database in rails 7.2+ - [@markokajzer](https://github.com/markokajzer).
* [#176](https://github.com/slack-ruby/slack-ruby-bot-server/pull/176): Deps: bump mongoid-scroll to 2.0 - [@markokajzer](https://github.com/markokajzer).

### 2.1.1 (2023/07/25)

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ case ENV.fetch('DATABASE_ADAPTER', nil)
when 'mongoid' then
gem 'kaminari-mongoid'
gem 'mongoid', ENV['MONGOID_VERSION'] || '~> 7.3.0'
gem 'mongoid-scroll', '~> 1.0.1'
gem 'mongoid-scroll', '~> 2.0'
gem 'mongoid-shell'

group :development, :test do
Expand Down
4 changes: 2 additions & 2 deletions lib/slack-ruby-bot-server/api/helpers/cursor_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def paginate_by_cursor(coll, _options)
coll = coll.skip(params[:offset].to_i) if params.key?(:offset)
size = (params[:size] || 10).to_i
coll = coll.limit(size)
coll.scroll(params[:cursor]) do |record, next_cursor|
coll.scroll(params[:cursor]) do |record, iterator|
results[:results] << record if record
results[:next] = next_cursor.to_s
results[:next] = iterator.next_cursor.to_s
break if results[:results].count >= size
end
results[:total_count] = coll.count if params[:total_count] && coll.respond_to?(:count)
Expand Down

0 comments on commit 99e60f2

Please sign in to comment.