mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Fix bug in UserDatatable query affecting PostgreSQL
Resolves:
$ docker-compose run --rm osem bundle exec rspec ./spec/datatables/user_datatable_spec.rb:97
…
ActiveRecord::StatementInvalid:
PG::GroupingError: ERROR: column "users.id" must appear in the GROUP BY clause or be used in an aggregate function
This commit is contained in:
parent
d3e73b103f
commit
4182b6fb8f
1 changed files with 2 additions and 2 deletions
|
|
@ -49,12 +49,12 @@ class UserDatatable < AjaxDatatablesRails::Base
|
|||
|
||||
# Workaround for jbox-web/ajax-datatables-rails#293
|
||||
def records_total_count
|
||||
fetch_records.unscope(:group).count(:all)
|
||||
fetch_records.unscope(:group, :select).count(:all)
|
||||
end
|
||||
|
||||
# Workaround for jbox-web/ajax-datatables-rails#293
|
||||
def records_filtered_count
|
||||
filter_records(fetch_records).unscope(:group).count(:all)
|
||||
filter_records(fetch_records).unscope(:group, :select).count(:all)
|
||||
end
|
||||
|
||||
# ==== These methods represent the basic operations to perform on records
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue