Module: Moribus::TrackedBehavior

Extended by:
ActiveSupport::Concern
Defined in:
lib/moribus/tracked_behavior.rb

Overview

Adds tracked behavior to a model. A tracked model should have an ‘is_current’ boolean column. Whenever the changed tracked object is about to be saved, it memorizes its id, marks itself as a new record, and then allows ActiveRecord to save it via standard means. If the record was successfully saved, the memorized id is used to update the ‘is_current’ flag for the effectively replaced record.

Defined Under Namespace

Modules: ClassMethods