Class: Athar::TableEvent

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ActorLookup
Defined in:
lib/athar/table_event.rb

Constant Summary collapse

EVENT_TYPE_TRUNCATE =
"truncate"

Class Method Summary collapse

Methods included from ActorLookup

#actor

Class Method Details

.for_table(table_name) ⇒ Object



18
19
20
# File 'lib/athar/table_event.rb', line 18

def for_table(table_name)
  where(table_name: table_name.to_s)
end

.recentObject



14
15
16
# File 'lib/athar/table_event.rb', line 14

def recent
  order(occurred_at: :desc, id: :desc)
end

.truncateObject



22
23
24
# File 'lib/athar/table_event.rb', line 22

def truncate
  where(event_type: EVENT_TYPE_TRUNCATE)
end