class Post::BaseQuery

Included Modules

Direct Known Subclasses

Defined in:

Class Method Summary

Instance Method Summary

Macro Summary

Class Method Detail

def self.all #

def self.find(id) #

def self.first #
Description copied from module Enumerable(Post)

Returns the first element in the collection. Raises Enumerable::EmptyError if the collection is empty.

([1, 2, 3]).first   # => 1
([] of Int32).first # raises Enumerable::EmptyError

def self.first? #
Description copied from module Enumerable(Post)

Returns the first element in the collection. When the collection is empty, returns nil.

([1, 2, 3]).first?   # => 1
([] of Int32).first? # => nil

def self.last #

def self.last? #

def self.new_with_existing_query(query : Avram::QueryBuilder) #

def self.truncate #

Instance Method Detail

def body(value) #

def body #

def clone #

Returns a copy of self with all instance variables cloned.


def created_at(value) #

def created_at #

def find(id) #

def id(value) #

def id #

def update(id : UUID | Nothing = Nothing.new, created_at : Time | Nothing = Nothing.new, updated_at : Time | Nothing = Nothing.new, body : String | Nothing = Nothing.new) : Int64 #
Description copied from module Avram::Queryable(Post)

Update the records using the query's where clauses, or all records if no wheres are added.

Returns the number of records updated as Int64.

# Update all comments with the word "spam" as spam
CommentQuery.new.body.ilike("spam").update(spam: true)

def updated_at(value) #

def updated_at #

Macro Detail

macro generate_criteria_method(name, type) #