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
|
||||
def get_raw_records
|
||||
User.left_outer_joins(:registrations, :roles).distinct.select(
|
||||
"users.*, COUNT(CASE WHEN registrations.attended = 't' THEN 1 END) AS attended_count"
|
||||
).group(
|
||||
'users.id, users.name, users.email, users.confirmed_at'
|
||||
User.left_outer_joins(:registrations, :roles).select(
|
||||
"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'
|
||||
# )
|
||||
end
|
||||
# rubocop:enable Naming/AccessorMethodName
|
||||
|
||||
def records_total_count
|
||||
fetch_records.unscope(:group).count(:all)
|
||||
fetch_records.unscoped.count(:id)
|
||||
end
|
||||
|
||||
def records_filtered_count
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue