class SaveMerchant

Defined in:

operations/save_merchant.cr

Constant Summary

ATTRIBUTES = [] of Nil
COLUMN_ATTRIBUTES = [{name: id, type: UUID, nilable: false, autogenerated: true, value: nil}, {name: created_at, type: Time, nilable: false, autogenerated: true, value: nil}, {name: updated_at, type: Time, nilable: false, autogenerated: true, value: nil}, {name: name, type: String, nilable: false, autogenerated: false, value: nil}, {name: description, type: String, nilable: false, autogenerated: false, value: nil}, {name: user_id, type: User::PrimaryKeyType, nilable: false, autogenerated: false, value: nil}, {name: id, type: UUID, nilable: false, autogenerated: true, value: nil}, {name: created_at, type: Time, nilable: false, autogenerated: true, value: nil}, {name: updated_at, type: Time, nilable: false, autogenerated: true, value: nil}, {name: name, type: String, nilable: false, autogenerated: false, value: nil}, {name: description, type: String, nilable: false, autogenerated: false, value: nil}, {name: user_id, type: User::PrimaryKeyType, nilable: false, autogenerated: false, value: nil}] of Nil
FOREIGN_KEY = "merchant_id"
OPERATION_NEEDS = [] of Nil

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Instance methods inherited from class Merchant::SaveOperation

attributes attributes, before_save before_save, created_at created_at, created_at=(_value) created_at=, description description, description=(_value) description=, id id, id=(_value) id=, name name, name=(_value) name=, permitted_params permitted_params, required_attributes required_attributes, set_attributes(id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new) set_attributes, set_created_at_from_param(_value) set_created_at_from_param, set_description_from_param(_value) set_description_from_param, set_id_from_param(_value) set_id_from_param, set_name_from_param(_value) set_name_from_param, set_updated_at_from_param(_value) set_updated_at_from_param, set_user_id_from_param(_value) set_user_id_from_param, set_uuid set_uuid, updated_at updated_at, updated_at=(_value) updated_at=, user_id user_id, user_id=(_value) user_id=

Constructor methods inherited from class Merchant::SaveOperation

new(record : T, params : Avram::Paramable, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new)
new(params : Avram::Paramable, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new)
new(record : T, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new)
new(id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new)
new

Class methods inherited from class Merchant::SaveOperation

create(params, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new, &)
create(id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new, &)
create(params : Hash, **named_args, &)
create
, create!(params, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new)
create!(id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new)
create!(params : Hash, **named_args)
create!
, update(record : T, with params, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new, &)
update(record : T, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new, &)
update(record : T, params : Hash, **named_args, &)
update
, update!(record : T, with params, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new)
update!(record : T, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = Nothing.new)
update!(record : T, params : Hash, **named_args)
update!

Constructor Detail

def self.new(record : T, params : Avram::Paramable, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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.create(params, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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 before_save #

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

permit_columns column_1, column_2


[View source]
def description #

[View source]
def name #

[View source]
def set_attributes(id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, name : String | Nothing = Nothing.new, description : String | Nothing = Nothing.new, user_id : User::PrimaryKeyType | Nothing = 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


Macro Detail

macro param_key(key) #