module

Ktistec::Model::ClassMethods

Instance methods

all(include_deleted : Bool = false, include_undone : Bool = false)

Returns all instances.

Source
all_subtypes

Returns type and all concrete (non-abstract) subtypes.

Source
columns(prefix = nil)

Returns table columns in format suitable for building queries.

Source
conditions(*terms, include_deleted : Bool = false, include_undone : Bool = false, options : Hash(String, Any) | Nil = nil, **options_) forall Any
Source
count(options : Hash(String, Any), include_deleted : Bool = false, include_undone : Bool = false) forall Any

Returns the count of saved instances.

Source
count(include_deleted : Bool = false, include_undone : Bool = false, **options)

Returns the count of saved instances.

Source
empty?

Returns true if no instances exist.

Source
exec(query : String, *args_, args : Enumerable | Nil = nil)

Runs the query.

Returns the number of rows affected.

Source
find(_id id : Int64 | Nil, include_deleted : Bool = false, include_undone : Bool = false)

Finds the saved instance.

Raises NotFound if no such saved instance exists.

Source
find(options : Hash(String, Any), include_deleted : Bool = false, include_undone : Bool = false) forall Any

Finds the saved instance.

Raises NotFound if no such saved instance exists.

Source
find(include_deleted : Bool = false, include_undone : Bool = false, **options)

Finds the saved instance.

Raises NotFound if no such saved instance exists.

Source
find?(_id id : Int64 | Nil, include_deleted : Bool = false, include_undone : Bool = false)

Finds the saved instance.

Returns nil if no such saved instance exists.

Source
find?(options : Hash(String, Any), include_deleted : Bool = false, include_undone : Bool = false) forall Any

Finds the saved instance.

Returns nil if no such saved instance exists.

Source
find?(include_deleted : Bool = false, include_undone : Bool = false, **options)

Finds the saved instance.

Returns nil if no such saved instance exists.

Source
find_or_create(options : Hash(String, Any), include_deleted : Bool = false, include_undone : Bool = false, skip_validation : Bool = false, skip_associated : Bool = false) forall Any

Finds an existing instance, or instantiates and saves a new instance.

Source
find_or_create(include_deleted : Bool = false, include_undone : Bool = false, skip_validation : Bool = false, skip_associated : Bool = false, **options)

Finds an existing instance, or instantiates and saves a new instance.

Source
find_or_new(options : Hash(String, Any), include_deleted : Bool = false, include_undone : Bool = false) forall Any

Finds an existing instance or instantiates a new instance.

Source
find_or_new(include_deleted : Bool = false, include_undone : Bool = false, **options)

Finds an existing instance or instantiates a new instance.

Source
persistent_columns
Source
scalar(query : String, *args_, args : Enumerable | Nil = nil)

Runs the query.

Returns the result.

Source
sql(query : String, *arguments, args : Enumerable | Nil = nil)

Runs the query.

Returns saved instances.

Source
table(as_name = nil)

Returns table name in format suitable for building queries.

Source
table_name

Returns the table name.

Source
values(options : Hash(String, Any) | Nil = nil, **options_) forall Any
Source
where(options : Hash(String, Any), include_deleted : Bool = false, include_undone : Bool = false) forall Any

Returns saved instances.

Source
where(where : String, *arguments, include_deleted : Bool = false, include_undone : Bool = false)

Returns saved instances.

Source
where(include_deleted : Bool = false, include_undone : Bool = false, **options)

Returns saved instances.

Source