Module: Congo::Migration

Included in:
ContentType
Defined in:
lib/congo/migration.rb

Defined Under Namespace

Modules: InstanceMethods Classes: Migration

Class Method Summary collapse

Class Method Details

.included(model) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/congo/migration.rb', line 4

def self.included(model)
  model.class_eval do
    include InstanceMethods
    
    key :version, Integer, :default => 0
    
    many :migrations, :class_name => 'Congo::Migration::Migration', :dependent => :destroy
    
    before_save :increment_version_and_build_migration
  end
end