module Ktistec::Model::ClassMethods
Defined in:
framework/model.crInstance Method Summary
-
#all(include_deleted : Bool = false, include_undone : Bool = false)
Returns all instances.
-
#all_subtypes
Returns type and all subtypes.
-
#columns(prefix = nil)
Returns table columns in format suitable for building queries.
- #conditions(*terms, include_deleted : Bool = false, include_undone : Bool = false, options : Hash(String, Any) | Nil = nil, **options_) forall Any
-
#count(options : Hash(String, Any), include_deleted : Bool = false, include_undone : Bool = false) forall Any
Returns the count of saved instances.
-
#count(include_deleted : Bool = false, include_undone : Bool = false, **options)
Returns the count of saved instances.
-
#empty?
Returns true if no instances exist.
-
#exec(query : String, args : Array | Nil = nil)
Runs the query.
-
#exec(query : String, *args_)
Runs the query.
-
#find(_id id : Int | Nil, include_deleted : Bool = false, include_undone : Bool = false)
Finds the saved instance.
-
#find(options : Hash(String, Any), include_deleted : Bool = false, include_undone : Bool = false) forall Any
Finds the saved instance.
-
#find(include_deleted : Bool = false, include_undone : Bool = false, **options)
Finds the saved instance.
-
#find?(_id id : Int | Nil, include_deleted : Bool = false, include_undone : Bool = false)
Finds the saved instance.
-
#find?(options : Hash(String, Any), include_deleted : Bool = false, include_undone : Bool = false) forall Any
Finds the saved instance.
-
#find?(include_deleted : Bool = false, include_undone : Bool = false, **options)
Finds the saved instance.
-
#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.
-
#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.
-
#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.
-
#find_or_new(include_deleted : Bool = false, include_undone : Bool = false, **options)
Finds an existing instance or instantiates a new instance.
- #persistent_columns
-
#scalar(query : String, args : Array | Nil = nil)
Runs the query.
-
#scalar(query : String, *args_)
Runs the query.
-
#sql(query : String, *arguments)
Runs the query.
-
#table(as_name = nil)
Returns table name in format suitable for building queries.
-
#table_name
Returns the table name.
- #values(options : Hash(String, Any) | Nil = nil, **options_) forall Any
-
#where(options : Hash(String, Any), include_deleted : Bool = false, include_undone : Bool = false) forall Any
Returns saved instances.
-
#where(where : String, *arguments, include_deleted : Bool = false, include_undone : Bool = false)
Returns saved instances.
-
#where(include_deleted : Bool = false, include_undone : Bool = false, **options)
Returns saved instances.
Instance Method Detail
Returns all instances.
Returns the count of saved instances.
Returns the count of saved instances.
Runs the query.
Returns the number of rows affected.
Finds the saved instance.
Raises NotFound
if no such saved instance exists.
Finds the saved instance.
Raises NotFound
if no such saved instance exists.
Finds the saved instance.
Raises NotFound
if no such saved instance exists.
Finds the saved instance.
Returns nil
if no such saved instance exists.
Finds the saved instance.
Returns nil
if no such saved instance exists.
Finds the saved instance.
Returns nil
if no such saved instance exists.
Finds an existing instance, or instantiates and saves a new instance.
Finds an existing instance, or instantiates and saves a new instance.
Finds an existing instance or instantiates a new instance.
Finds an existing instance or instantiates a new instance.
Runs the query.
Returns the result.
Returns saved instances.
Returns saved instances.
Returns saved instances.