Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: bump mongoid-scroll to 2.0 #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading