Skip to content

Instantly share code, notes, and snippets.

View lirenyeo's full-sized avatar
🏇
Keep going!

Liren lirenyeo

🏇
Keep going!
View GitHub Profile
@lirenyeo
lirenyeo / export.rb
Created December 19, 2020 06:49 — forked from KevinSia/export.rb
require 'prawn'
arr = HallSession
.joins(:check_in_sessions, :hall)
.group('check_in_sessions.hall_session_id, auditorium_halls.name, hall_sessions.start_at, hall_sessions.end_at, hall_sessions.id')
.select('auditorium_halls.name as hall_name, hall_sessions.start_at, hall_sessions.end_at, COUNT(*) as c')
.order('hall_name, start_at, end_at')
.map do |ci|
[