Class: DataMapper::Migrator

Inherits:
Object
  • Object
show all
Defined in:
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/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/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/dm-core/migrator.rb', line 5

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

.subclasses=(obj) ⇒ Object



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

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