Module: LogBook::Recorder::RecordingInstanceMethods

Defined in:
lib/log_book/recorder.rb

Instance Method Summary collapse

Instance Method Details

#non_recording_columnsObject



45
46
47
# File 'lib/log_book/recorder.rb', line 45

def non_recording_columns
  self.class.non_recording_columns
end

#recording_attributesObject



41
42
43
# File 'lib/log_book/recorder.rb', line 41

def recording_attributes
  attributes.except(*non_recording_columns)
end

#recording_changesObject



25
26
27
# File 'lib/log_book/recorder.rb', line 25

def recording_changes
  @recording_changes ||= RecordingChanges.new(self)
end

#recording_keyObject



49
50
51
# File 'lib/log_book/recorder.rb', line 49

def recording_key
  "#{self.class.table_name}_#{id}"
end

#recording_optionsObject



29
30
31
# File 'lib/log_book/recorder.rb', line 29

def recording_options
  self.class.recording_options
end

#save_with_recordingObject



33
34
35
# File 'lib/log_book/recorder.rb', line 33

def save_with_recording
  with_recording { save }
end

#with_recording(&block) ⇒ Object



37
38
39
# File 'lib/log_book/recorder.rb', line 37

def with_recording(&block)
  self.class.with_recording(&block)
end