bogdan / datagrid

Gem to create tables grids with sortable columns and filters
MIT License
1.02k stars 115 forks source link

Mongoid 7.1.0 breaks Drivers::Mongoid#to_scope in datagrid/drivers/mongoid.rb #284

Closed mike-loopvoc closed 4 years ago

mike-loopvoc commented 4 years ago

The following code:

 def to_scope(scope)
    scope.where(nil)
  end

is no longer allowed by mongoid as of version 7.1.0 and causes an exception to be raised. The correct way to get the default scope is:

 def to_scope(scope)
    scope.all
  end

I have tested this in my application successfully. I would appreciate it if you could address this issue as soon as possible, as it is a breaking change for my application.

mike-loopvoc commented 4 years ago

Thanks very much!