Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. Teacher.available_at_or_around_or_partially start_time: Time.now, end_time: Time.now.+(2.hours)
  2.  
  3. SELECT "teachers".*
  4. INNER JOIN "teacher_availability_periods"
  5. ON "teacher_availability_periods"."teacher_id" = "teachers"."id"
  6. WHERE (((
  7. "teacher_availability_periods"."starts_at_sfsow" <= 446340)
  8. AND (
  9. "teacher_availability_periods"."ends_at_sfsow" >= 453540)
  10. OR ( (
  11. "teacher_availability_periods"."starts_at_sfsow" <= 442740)
  12. AND (
  13. "teacher_availability_periods"."ends_at_sfsow" >= 446340)
  14. OR (
  15. "teacher_availability_periods"."starts_at_sfsow" <= 453540)
  16. AND (
  17. "teacher_availability_periods"."ends_at_sfsow" >= 457140)))
  18. OR (
  19. "teacher_availability_periods"."starts_at_sfsow" >= 446340)
  20. AND (
  21. "teacher_availability_periods"."ends_at_sfsow" <= 453540))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement