Class: Dcmgr::Models::RequestLog

Inherits:
BaseNew
  • Object
show all
Defined in:
lib/dcmgr/models/request_log.rb

Constant Summary

Constants inherited from BaseNew

BaseNew::LOCK_TABLES_KEY

Instance Method Summary collapse

Methods inherited from BaseNew

Proxy, dataset, default_row_lock_mode=, install_data, install_data_hooks, lock!, #to_hash, unlock!, #with_timestamps?

Instance Method Details

#after_initializeObject



9
10
11
12
13
14
15
# File 'lib/dcmgr/models/request_log.rb', line 9

def after_initialize
  super
  self[:request_id] ||= Isono::Util.gen_id
  t = Time.now
  self[:requested_at] = t
  self[:requested_at_usec] = t.usec
end

#before_createObject



17
18
19
20
21
22
# File 'lib/dcmgr/models/request_log.rb', line 17

def before_create
  t = Time.now
  self[:responded_at] = t
  self[:responded_at_usec] = t.usec
  super
end