Module: Cms::Behaviors::Versioning

Defined in:
lib/cms/behaviors/versioning.rb

Overview

This behavior adds Versioning to an ActiveRecord object. It seriously monkeys with how objects are saved or updated.

This implementation is pretty tied to Rails 3 ActiveRecord. Here's how I understand it works: ActiveRecord alias chain- Here is the order that methods get called.

save

 save_with_transactions
 save_with_dirty
 save_with_validations
 AR::Base#save (save_without_validations)
 AR::Base#create_or_update_with_callbacks

AR::Base - Defines a 'save' method with no params
AR::Validations - alias save to a save_with_validations (which takes params)
ActiveRecord Object has:
- save_with_validations(options)
- save_without_validation() - (Original save)

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, MacroMethods