Module: Gluttonberg::Content::Versioning

Defined in:
lib/gluttonberg/content/versioning.rb

Overview

A mixin which allows for any arbitrary model to have multiple versions. It will generate the versioning models and add methods for creating, managing and retrieving different versions of a record. In reality this is behaving like a wrapper on acts_as_versioned

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary (collapse)

Class Method Details

+ (Object) included(klass)



13
14
15
16
17
18
# File 'lib/gluttonberg/content/versioning.rb', line 13

def self.included(klass)
  klass.class_eval do
    extend  ClassMethods
    include InstanceMethods          
  end
end

+ (Object) setup



9
10
11
# File 'lib/gluttonberg/content/versioning.rb', line 9

def self.setup
  ::ActiveRecord::Base.send :include, Gluttonberg::Content::Versioning
end