Class: DataMapper::Migrator

Inherits:
Object show all
Defined in:
lib/gems/dm-core-0.9.9/lib/dm-core/migrator.rb

Direct Known Subclasses

DestructiveMigrator

Class Method Summary collapse

Class Method Details

.inherited(klass) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/migrator.rb', line 13

def self.inherited(klass)
  subclasses << klass

  class << klass
    def models
      @models ||= []
    end
  end
end

.migrate(repository_name) ⇒ Object



23
24
25
26
27
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/migrator.rb', line 23

def self.migrate(repository_name)
  subclasses.collect do |migrator|
    migrator.migrate(repository_name)
  end.flatten
end

.subclassesObject



5
6
7
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/migrator.rb', line 5

def self.subclasses
  @@subclasses ||= []
end

.subclasses=(obj) ⇒ Object



9
10
11
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/migrator.rb', line 9

def self.subclasses=(obj)
  @@subclasses = obj
end