Instance methods
all(include_deleted : Bool = false, include_undone : Bool = false)
Sourceall_subtypes
Returns type and all concrete (non-abstract) subtypes.
Sourcecolumns(prefix = nil)
Returns table columns in format suitable for building queries.
Sourceconditions(*terms, include_deleted :
Bool = false, include_undone :
Bool = false, options :
Hash(
String,
Any) |
Nil = nil, **options_) forall
Any Sourcecount(options :
Hash(
String,
Any), include_deleted :
Bool = false, include_undone :
Bool = false) forall
Any Returns the count of saved instances.
Sourcecount(include_deleted : Bool = false, include_undone : Bool = false, **options)
Returns the count of saved instances.
Sourceempty?
Returns true if no instances exist.
Sourceexec(query : String, *args_, args : Enumerable | Nil = nil)
Runs the query.
Returns the number of rows affected.
Sourcefind(_id id : Int64 | Nil, include_deleted : Bool = false, include_undone : Bool = false)
Finds the saved instance.
Raises NotFound if no such saved instance exists.
Sourcefind(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.
Sourcefind(include_deleted : Bool = false, include_undone : Bool = false, **options)
Finds the saved instance.
Raises NotFound if no such saved instance exists.
Sourcefind?(_id id : Int64 | Nil, include_deleted : Bool = false, include_undone : Bool = false)
Finds the saved instance.
Returns nil if no such saved instance exists.
Sourcefind?(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.
Sourcefind?(include_deleted : Bool = false, include_undone : Bool = false, **options)
Finds the saved instance.
Returns nil if no such saved instance exists.
Sourcefind_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.
Sourcefind_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.
Sourcefind_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.
Sourcefind_or_new(include_deleted : Bool = false, include_undone : Bool = false, **options)
Finds an existing instance or instantiates a new instance.
Sourcescalar(query : String, *args_, args : Enumerable | Nil = nil)
Runs the query.
Returns the result.
Sourcesql(query : String, *arguments, args : Enumerable | Nil = nil)
Runs the query.
Returns saved instances.
Sourcetable(as_name = nil)
Returns table name in format suitable for building queries.
Sourcevalues(options :
Hash(
String,
Any) |
Nil = nil, **options_) forall
Any Sourcewhere(options :
Hash(
String,
Any), include_deleted :
Bool = false, include_undone :
Bool = false) forall
Any Sourcewhere(where : String, *arguments, include_deleted : Bool = false, include_undone : Bool = false)
Sourcewhere(include_deleted : Bool = false, include_undone : Bool = false, **options)
Source