class SavePessoa

Defined in:

operations/save_pessoa.cr

Constant Summary

ATTRIBUTES = [nascimento_as_string : String, stack_as_string : String] of Nil
COLUMN_ATTRIBUTES = [{name: id, type: UUID, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: apelido, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: nome, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: nascimento, type: Time, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: stack, type: String, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: id, type: UUID, nilable: false, autogenerated: true, value: nil, serialized: false}, {name: apelido, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: nome, type: String, nilable: false, autogenerated: false, value: nil, serialized: false}, {name: nascimento, type: Time, nilable: true, autogenerated: false, value: nil, serialized: false}, {name: stack, type: String, nilable: true, autogenerated: false, value: nil, serialized: false}] of Nil
FOREIGN_KEY = "pessoa_id"
OPERATION_NEEDS = [] of Nil

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Instance methods inherited from class Pessoa::SaveOperation

apelido apelido, apelido=(_value) apelido=, attributes attributes, id id, id=(_value) id=, nascimento nascimento, nascimento=(_value) nascimento=, nome nome, nome=(_value) nome=, permitted_params : Hash(String, Array(String) | String) permitted_params, required_attributes required_attributes, set_apelido_from_param(_value) set_apelido_from_param, set_attributes(id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new) set_attributes, set_id_from_param(_value) set_id_from_param, set_nascimento_from_param(_value) set_nascimento_from_param, set_nome_from_param(_value) set_nome_from_param, set_stack_from_param(_value) set_stack_from_param, stack stack, stack=(_value) stack=

Constructor methods inherited from class Pessoa::SaveOperation

new(record : T, params : Avram::Paramable, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new)
new(params : Avram::Paramable, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new)
new(record : T, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new)
new(id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new)
new

Class methods inherited from class Pessoa::SaveOperation

create(params, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, &)
create(id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, &)
create(params : Hash, **named_args, &)
create
, create!(params, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new)
create!(id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new)
create!(params : Hash, **named_args)
create!
, update(record : T, with params, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, &)
update(record : T, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, &)
update(record : T, params : Hash, **named_args, &)
update
, update!(record : T, with params, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new)
update!(record : T, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new)
update!(record : T, params : Hash, **named_args)
update!

Constructor Detail

def self.new(record : T, params : Avram::Paramable, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.new(params : Avram::Paramable, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.new(record : T, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.new(id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


Class Method Detail

def self.build(pessoa : Pessoa) #

[View source]
def self.create(params, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new, &) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.create(id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new, &) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.create(params : Hash, **named_args, &) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.create!(params, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.create!(id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.create!(params : Hash, **named_args) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.update(record : T, with params, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new, &) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.update(record : T, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new, &) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.update(record : T, params : Hash, **named_args, &) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.update!(record : T, with params, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.update!(record : T, id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def self.update!(record : T, params : Hash, **named_args) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


Instance Method Detail

def apelido #

To save user provided params to the database, you must permit them https://luckyframework.org/guides/database/saving-records#perma-permitting-columns


[View source]
def attributes #

[View source]
def before_save #

[View source]
def id #

To save user provided params to the database, you must permit them https://luckyframework.org/guides/database/saving-records#perma-permitting-columns


[View source]
def nascimento #

To save user provided params to the database, you must permit them https://luckyframework.org/guides/database/saving-records#perma-permitting-columns


[View source]
def nascimento_as_string #

[View source]
def nome #

To save user provided params to the database, you must permit them https://luckyframework.org/guides/database/saving-records#perma-permitting-columns


[View source]
def set_attributes(id : UUID | Avram::Nothing = Avram::Nothing.new, apelido : String | Avram::Nothing = Avram::Nothing.new, nome : String | Avram::Nothing = Avram::Nothing.new, nascimento : Time | Avram::Nothing | Nil = Avram::Nothing.new, stack : String | Avram::Nothing | Nil = Avram::Nothing.new, nascimento_as_string : String | Avram::Nothing = Avram::Nothing.new, stack_as_string : String | Avram::Nothing = Avram::Nothing.new) #

@type is not correct in this method, but is in the macro we call below That is why this extrac macro was extracted. We need @type to get the attributes for this SaveOperation


def stack #

To save user provided params to the database, you must permit them https://luckyframework.org/guides/database/saving-records#perma-permitting-columns


[View source]
def stack_as_string #

[View source]
def values : Hash(Symbol, String | Nil) #

[View source]

Macro Detail

macro param_key(key) #