class Laspatule::Repositories::DB::Recipes

Included Modules

Defined in:

laspatule/repositories/db/recipes.cr

Constructors

Instance Method Summary

Instance methods inherited from module Laspatule::Repositories::Recipes

create(recipe : Models::CreateRecipe, user_id : Int32) : Int32 create, get_all(page_size : Int32, next_page previous_page : String | Nil = nil) : Models::Page(Models::Recipe) get_all, get_by_id(id : Int32) : Models::Recipe get_by_id

Constructor Detail

def self.new(db : ::DB::Database) #

[View source]

Instance Method Detail

def create(recipe : Models::CreateRecipe, user_id : Int32) : Int32 #
Description copied from module Laspatule::Repositories::Recipes

Creates a new recipe and returns its id.


[View source]
def get_all(page_size : Int32, next_page previous_page : String | Nil = nil) : Models::Page(Models::Recipe) #
Description copied from module Laspatule::Repositories::Recipes

Gets all recipes ordered by name,

This is a paginated query, see Models::Page for the pagination instructions.


[View source]
def get_by_id(id : Int32) : Models::Recipe #
Description copied from module Laspatule::Repositories::Recipes

Gets a recipe by id.


[View source]