class SavePost

Defined in:

operations/save_post.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: body, type: String, 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: body, type: String, nilable: false, autogenerated: false, value: nil}] of Nil
FOREIGN_KEY = "post_id"
OPERATION_NEEDS = [] of Nil

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Instance methods inherited from class Post::SaveOperation

attributes attributes, before_save before_save, body body, body=(_value) body=, created_at created_at, created_at=(_value) created_at=, id id, id=(_value) id=, 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, body : String | Nothing = Nothing.new) set_attributes, set_body_from_param(_value) set_body_from_param, set_created_at_from_param(_value) set_created_at_from_param, set_id_from_param(_value) set_id_from_param, set_updated_at_from_param(_value) set_updated_at_from_param, set_uuid set_uuid, updated_at updated_at, updated_at=(_value) updated_at=

Constructor methods inherited from class Post::SaveOperation

new(record : T, params : Avram::Paramable, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | Nothing = Nothing.new)
new(params : Avram::Paramable, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | Nothing = Nothing.new)
new(record : T, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | Nothing = Nothing.new)
new(id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | Nothing = Nothing.new)
new

Class methods inherited from class Post::SaveOperation

create(params, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | Nothing = Nothing.new, &)
create(id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | 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, body : String | Nothing = Nothing.new)
create!(id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | 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, body : String | Nothing = Nothing.new, &)
update(record : T, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | 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, body : String | Nothing = Nothing.new)
update!(record : T, id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | 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, body : String | 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, body : String | 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, body : String | 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, body : String | 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, body : String | 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, body : String | 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, body : String | 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, body : String | 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, body : String | 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, body : String | 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, body : String | 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, body : String | 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 body #

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 set_attributes(id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | 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) #