class

Granite::Base

Inherits Granite::ConnectionManagement < Granite::Querying < Granite::Select < Granite::Migrator < Granite::ValidationHelpers < Granite::Validators < Granite::Transactions < Granite::Tables < Granite::Columns < Granite::Callbacks < Granite::Associations < Reference < Object

Granite::Base is the base class for your model objects.

Class methods

adapter
Source
connection_switch_wait_period

Default value for the time a model waits before using a reader database connection for read operations all models use this value. Change it to change it in all Granite::Base models.

connection_switch_wait_period=(connection_switch_wait_period : Int32)

Default value for the time a model waits before using a reader database connection for read operations all models use this value. Change it to change it in all Granite::Base models.

current_adapter
current_adapter=(current_adapter : Granite::Adapter::Base | Nil)
last_write_time
Source
reader_adapter
reader_adapter=(reader_adapter : Granite::Adapter::Base | Nil)
schedule_adapter_switch
Source
switch_to_reader_adapter
Source
switch_to_writer_adapter
Source
time_since_last_write
Source
update_last_write_time

This is done this way because callbacks don't work on class mthods

Source
writer_adapter
writer_adapter=(writer_adapter : Granite::Adapter::Base | Nil)

Instance methods

schedule_adapter_switch
Source
switch_to_reader_adapter
Source
switch_to_writer_adapter
Source
time_since_last_write
Source
update_last_write_time
Source