class Repository::Collection

Overview

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

Defined in:

models/repository.cr:2
models/repository.cr:45
models/repository.cr:47
models/repository.cr:64

Instance Method Summary

Instance Method Detail

def published #

[View source]
def search(str) #

def with_counts #

[View source]
def with_dependencies(&block : Repository::Collection -> ) : self #

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


def with_dependencies #

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

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


def with_dependents #

def with_forks(&block : Repository::Collection -> ) : self #

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


def with_forks #

def with_languages(&block : Language::Collection -> ) : self #

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


def with_languages #

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_releases(fetch_columns = false, &block : Release::Collection -> ) : self #

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


def with_releases(fetch_columns = false) #

def with_repository_forks(fetch_columns = false, &block : RepositoryFork::Collection -> ) : self #

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


def with_repository_forks(fetch_columns = false) #

def with_repository_languages(fetch_columns = false, &block : RepositoryLanguage::Collection -> ) : self #

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


def with_repository_languages(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 #

def with_user(fetch_columns = false, &block : User::Collection -> ) : self #

def with_user(fetch_columns = false) : self #

def without_releases #

[View source]