Class: DataMapper::Migrator
- Inherits:
-
Object
- Object
- DataMapper::Migrator
- Defined in:
- lib/dm-core/migrator.rb
Direct Known Subclasses
Class Method Summary collapse
- .inherited(klass) ⇒ Object
- .migrate(repository_name) ⇒ Object
- .subclasses ⇒ Object
- .subclasses=(obj) ⇒ Object
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 |
.subclasses ⇒ Object
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 |