class Post::Collection

Overview

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

Defined in:

models/post.cr

Instance Method Summary

Instance Method Detail

def search(str) #

def with_author(fetch_columns = false, &block : Author::Collection -> ) : self #

def with_author(fetch_columns = false) : self #

def with_dependencies(&block : Post::Collection -> ) : self #

Eager load the relation dependencies. Use it to avoid N+1 queries.


def with_dependencies #

def with_dependents(&block : Post::Collection -> ) : self #

Eager load the relation dependents. Use it to avoid N+1 queries.


def with_dependents #

def with_relationships(fetch_columns = false, &block : Relationship::Collection -> ) : self #

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


def with_relationships(fetch_columns = false) #

def with_tags(&block : Tag::Collection -> ) : self #

Eager load the relation tags. Use it to avoid N+1 queries.


def with_tags #