Module: ActiveRecord::Journal::Journable
- Defined in:
- lib/active_record/journal/journable.rb,
lib/active_record/journal/journable/rule.rb,
lib/active_record/journal/journable/changes.rb,
lib/active_record/journal/journable/context.rb,
lib/active_record/journal/journable/options.rb,
lib/active_record/journal/journable/callback.rb,
lib/active_record/journal/journable/attributes.rb
Defined Under Namespace
Classes: Attributes, Callback, Changes, Context, OptionError, Options, Rule
Class Method Summary collapse
Instance Method Summary collapse
-
#journal_reads(**kwargs) ⇒ Object
Enable & configure the tracking of the read actions.
-
#journal_writes(**kwargs) ⇒ Object
Enable & configure the tracking of the writes, updates and destroy actions.
Class Method Details
.extended(subject) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/active_record/journal/journable.rb', line 13 def self.extended(subject) subject.class_attribute :journable_context subject.after_find(&Callback.new('read')) subject.after_create(&Callback.new('create')) subject.before_update(&Callback.new('update')) subject.before_destroy(&Callback.new('destroy')) end |
Instance Method Details
#journal_reads(**kwargs) ⇒ Object
Enable & configure the tracking of the read actions
24 25 26 27 |
# File 'lib/active_record/journal/journable.rb', line 24 def journal_reads(**kwargs) init_journable_context journable_context.record(self, :reads, **kwargs) end |
#journal_writes(**kwargs) ⇒ Object
Enable & configure the tracking of the writes, updates and destroy actions
31 32 33 34 |
# File 'lib/active_record/journal/journable.rb', line 31 def journal_writes(**kwargs) init_journable_context journable_context.record(self, :writes, **kwargs) end |