class

Notification

Inherits Avram::PrimaryKeyMethods < DB::Mappable < DB::Serializable < LuckyCache::Cachable < BaseModel < DB::Mappable < DB::Serializable < LuckyCache::Cachable < Avram::Model < Avram::SchemaEnforcer < Avram::Polymorphic < Avram::Associations < Avram::Associations::BelongsTo < Avram::Associations::HasOne < Avram::Associations::HasMany < Reference < Object

Constants

ASSOCIATIONS = [{type: User, assoc_name: user, foreign_key: :user_id, relationship_type: :belongs_to, through: nil, base_query_class: nil}, {type: Event, assoc_name: event, foreign_key: :event_id, relationship_type: :belongs_to, through: nil, base_query_class: nil}] of Nil
COLUMNS = [{name: id, type: Int64, nilable: false, autogenerated: true, value: nil, serialized: false, allow_blank: false}, {name: created_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false, allow_blank: false}, {name: updated_at, type: Time, nilable: false, autogenerated: true, value: nil, serialized: false, allow_blank: false}, {name: notification_type, type: Notification::NotificationType, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: status, type: Notification::Status, nilable: false, autogenerated: false, value: Notification::Status::Pending, serialized: false, allow_blank: false}, {name: title, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: message, type: String, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: scheduled_for, type: Time, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: sent_at, type: Time, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: user_id, type: User::PrimaryKeyType, nilable: false, autogenerated: false, value: nil, serialized: false, allow_blank: false}, {name: event_id, type: Event::PrimaryKeyType, nilable: true, autogenerated: false, value: nil, serialized: false, allow_blank: false}] of Nil
PRIMARY_KEY_NAME = :id
PRIMARY_KEY_TYPE = Int64

Constructors

new(id : Int64, created_at : Time, updated_at : Time, notification_type : Int32 | Int64, status : Int32 | Int64, title : String, message : String, scheduled_for : Time | Nil, sent_at : Time | Nil, user_id : Int64, event_id : Int64 | Nil)
new(rs : DB::ResultSet)

Class methods

column_names
columns
ensure_correct_column_mappings!
from_rs(rs : DB::ResultSet)
primary_key_name
schema_enforcer_validations
table_name

Instance methods

base_query_class

This makes it easy for plugins and extensions to use the base SaveOperation

created_at
delete_operation_class
event
event!
event_count
event_id
event_preloaded?

Returns true if the association has been preloaded

event_query
id
message
notification_type
save_operation_class
scheduled_for
sent_at
status
title
updated_at
user
user!
user_count
user_id
user_preloaded?

Returns true if the association has been preloaded

user_query

Nested types