module LogBook::ControllerRecord

Public Instance Methods

current_author() click to toggle source
# File lib/log_book/controller_record.rb, line 22
def current_author
  raise NotImplementedError unless respond_to?(LogBook.config.author_method, true)

  send(LogBook.config.author_method)
end
enable_recording() click to toggle source
# File lib/log_book/controller_record.rb, line 10
def enable_recording
  action = "#{controller_name}##{action_name}"
  author = current_author
  request_uuid = try(:request).try(:uuid) || SecureRandom.hex
  LogBook::Store.tree = LogBook::Tree.new(action: action, author: author, request_uuid: request_uuid)
  LogBook.enable_recording
end
save_records() click to toggle source
# File lib/log_book/controller_record.rb, line 18
def save_records
  LogBook::SaveRecords.call
end