|
|
@ -19,7 +19,7 @@ class Admins::SchoolQuery < ApplicationQuery
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Rails.logger.info("#########school_name: ##{schools.first.name}")
|
|
|
|
Rails.logger.info("#########school_name: ##{schools.first.name}")
|
|
|
|
Rails.logger.info("#########school_id: ##{schools.first.id}")
|
|
|
|
Rails.logger.info("#########school_id: ##{schools.first.id}")
|
|
|
|
schools = schools.joins(:user_extensions).group("schools.id")
|
|
|
|
schools = schools.joins("right join user_extensions on user_extensions.school_id = schools.id").group("schools.id")
|
|
|
|
Rails.logger.info("#########school_id: ##{schools.first.id}")
|
|
|
|
Rails.logger.info("#########school_id: ##{schools.first.id}")
|
|
|
|
schools = schools.select('schools.*, COUNT(*) AS users_count')
|
|
|
|
schools = schools.select('schools.*, COUNT(*) AS users_count')
|
|
|
|
custom_sort schools, params[:sort_by], params[:sort_direction]
|
|
|
|
custom_sort schools, params[:sort_by], params[:sort_direction]
|
|
|
|