Module: LogBook::Recorder::RecordingInstanceMethods
- Defined in:
- lib/log_book/recorder.rb
Instance Method Summary collapse
- #new_record ⇒ Object
- #non_recording_columns ⇒ Object
- #recording_attributes ⇒ Object
- #save_with_recording ⇒ Object
- #to_squash? ⇒ Boolean
- #with_recording(&block) ⇒ Object
Instance Method Details
#new_record ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/log_book/recorder.rb', line 36 def new_record record = LogBook::Record.new( action: LogBook.store[:action], record_changes: record_changes, author: LogBook.store[:author], subject: self, meta: {} ) record. = (record) if [:meta].present? record.parent = send([:parent]) if [:parent].present? record end |
#non_recording_columns ⇒ Object
53 54 55 |
# File 'lib/log_book/recorder.rb', line 53 def non_recording_columns self.class.non_recording_columns end |
#recording_attributes ⇒ Object
49 50 51 |
# File 'lib/log_book/recorder.rb', line 49 def recording_attributes attributes.except(*non_recording_columns) end |
#save_with_recording ⇒ Object
28 29 30 |
# File 'lib/log_book/recorder.rb', line 28 def save_with_recording with_recording { save } end |
#to_squash? ⇒ Boolean
24 25 26 |
# File 'lib/log_book/recorder.rb', line 24 def to_squash? [:squash] end |
#with_recording(&block) ⇒ Object
32 33 34 |
# File 'lib/log_book/recorder.rb', line 32 def with_recording(&block) self.class.with_recording(&block) end |