Module: LogBook::ControllerRecord

Extended by:
ActiveSupport::Concern
Defined in:
lib/log_book/controller_record.rb

Instance Method Summary collapse

Instance Method Details

#current_authorObject

Raises:

  • (NotImplementedError)


23
24
25
26
# File 'lib/log_book/controller_record.rb', line 23

def current_author
  raise NotImplementedError unless respond_to?(LogBook.config.author_method, true)
  send(LogBook.config.author_method)
end

#enable_recordingObject



10
11
12
13
14
15
# File 'lib/log_book/controller_record.rb', line 10

def enable_recording
  LogBook.store[:controller] = self
  LogBook.store[:author] = current_author
  LogBook.store[:request_uuid] = try(:request).try(:uuid) || SecureRandom.hex
  LogBook.enable_recording
end

#record_squashingObject



17
18
19
20
21
# File 'lib/log_book/controller_record.rb', line 17

def record_squashing
  LogBook.with_record_squashing do
    yield
  end
end