module DynFork::QPaladins::Save

Overview

Creating and updating documents in the database.

Direct including types

Defined in:

dynfork/paladins/save.cr

Instance Method Summary

Instance Method Detail

def save : Bool #

Creating and updating documents in the database.
This method pre-uses the check method.

Simple example:

@[DynFork::Meta(service_name: "Accounts")]
struct User < DynFork::Model
  getter username = DynFork::Fields::TextField.new
  getter birthday = DynFork::Fields::DateField.new
end

user = User.new
user.username.value = "username"
user.birthday.value = "1970-01-01"

user.print_err unless user.save
# print_err - convenient during development.

[View source]