more attempts to make datatables work
This commit is contained in:
parent
29f6a41c98
commit
cdcf550ee0
1 changed files with 6 additions and 5 deletions
|
|
@ -40,16 +40,17 @@ class UserDatatable < AjaxDatatablesRails::Base
|
||||||
|
|
||||||
# rubocop:disable Naming/AccessorMethodName
|
# rubocop:disable Naming/AccessorMethodName
|
||||||
def get_raw_records
|
def get_raw_records
|
||||||
User.left_outer_joins(:registrations, :roles).distinct.select(
|
User.left_outer_joins(:registrations, :roles).select(
|
||||||
"users.*, COUNT(CASE WHEN registrations.attended = 't' THEN 1 END) AS attended_count"
|
"DISTINCT users.id, users.name, users.email, users.confirmed_at, COUNT(CASE WHEN registrations.attended = 't' THEN 1 END) AS attended_count"
|
||||||
).group(
|
|
||||||
'users.id, users.name, users.email, users.confirmed_at'
|
|
||||||
)
|
)
|
||||||
|
# .group(
|
||||||
|
# 'users.id, users.name, users.email, users.confirmed_at'
|
||||||
|
# )
|
||||||
end
|
end
|
||||||
# rubocop:enable Naming/AccessorMethodName
|
# rubocop:enable Naming/AccessorMethodName
|
||||||
|
|
||||||
def records_total_count
|
def records_total_count
|
||||||
fetch_records.unscope(:group).count(:all)
|
fetch_records.unscoped.count(:id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def records_filtered_count
|
def records_filtered_count
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue