class Booking::Collection

Overview

Addition of the method for eager loading and N+1 avoidance.

Defined in:

models/booking.cr:2
models/booking.cr:74
models/booking.cr:78
models/booking.cr:82
models/booking.cr:86
models/booking.cr:107
models/booking.cr:120
models/booking.cr:124
models/booking.cr:128
models/booking.cr:132
models/booking.cr:138
models/booking.cr:147
models/booking.cr:156
models/booking.cr:170

Instance Method Summary

Instance Method Detail

def booked_between(tenant_id, period_start, period_end) #

[View source]
def by_tenant(tenant_id) #

[View source]
def by_user_email(user_email) #

[View source]
def by_user_id(user_id) #

[View source]
def by_user_or_email(user_id_value, user_email_value, include_booked_by) #

[View source]
def by_zones(zones) #

[View source]
def is_approved(value) #

[View source]
def is_checked_in(value) #

[View source]
def is_created_after(time) #

[View source]
def is_created_before(time) #

[View source]
def is_extension_data(value) #

[View source]
def is_rejected(value) #

[View source]
def is_state(state) #

[View source]
def with_attendees(fetch_columns = false, &block : Attendee::Collection -> ) : self #

Eager load the has many relation attendees. Use it to avoid N+1 queries.


def with_attendees(fetch_columns = false) #

def with_tenant(fetch_columns = false, &block : Tenant::Collection -> ) : self #

def with_tenant(fetch_columns = false) : self #