Class: SM::SuperMigration
- Inherits:
-
Object
- Object
- SM::SuperMigration
- Defined in:
- lib/super_migration.rb
Constant Summary collapse
- @@from_db_options =
nil
- @@to_db_options =
nil
- @@current_table_from =
I have a feeling this may not be quite good
nil
- @@current_table_to =
nil
- @@current_record =
Record.new
Class Method Summary collapse
- .current_record ⇒ Object
- .current_record=(record_hash) ⇒ Object
- .current_table_from ⇒ Object
- .current_table_from=(table_from) ⇒ Object
- .current_table_to ⇒ Object
- .current_table_to=(table_to) ⇒ Object
- .from_database(options = {}) ⇒ Object
- .from_db_options ⇒ Object
- .migrate(&block) ⇒ Object
-
.setup(&block) ⇒ Object
—.
- .to_database(options = {}) ⇒ Object
- .to_db_options ⇒ Object
Class Method Details
.current_record ⇒ Object
61 62 63 |
# File 'lib/super_migration.rb', line 61 def self.current_record @@current_record end |
.current_record=(record_hash) ⇒ Object
65 66 67 |
# File 'lib/super_migration.rb', line 65 def self.current_record=(record_hash) @@current_record = record_hash end |
.current_table_from ⇒ Object
45 46 47 |
# File 'lib/super_migration.rb', line 45 def self.current_table_from @@current_table_from end |
.current_table_from=(table_from) ⇒ Object
49 50 51 |
# File 'lib/super_migration.rb', line 49 def self.current_table_from=(table_from) @@current_table_from = table_from end |
.current_table_to ⇒ Object
53 54 55 |
# File 'lib/super_migration.rb', line 53 def self.current_table_to @@current_table_to end |
.current_table_to=(table_to) ⇒ Object
57 58 59 |
# File 'lib/super_migration.rb', line 57 def self.current_table_to=(table_to) @@current_table_to = table_to end |
.from_database(options = {}) ⇒ Object
27 28 29 30 |
# File 'lib/super_migration.rb', line 27 def self.from_database( = {}) return if .size < 4 @@from_db_options = .dup end |
.from_db_options ⇒ Object
37 38 39 |
# File 'lib/super_migration.rb', line 37 def self. @@from_db_options end |
.migrate(&block) ⇒ Object
23 24 25 |
# File 'lib/super_migration.rb', line 23 def self.migrate(&block) yield end |
.setup(&block) ⇒ Object
19 20 21 |
# File 'lib/super_migration.rb', line 19 def self.setup(&block) block.call(self) end |
.to_database(options = {}) ⇒ Object
32 33 34 35 |
# File 'lib/super_migration.rb', line 32 def self.to_database( = {}) return if .size < 4 @@to_db_options = .dup end |
.to_db_options ⇒ Object
41 42 43 |
# File 'lib/super_migration.rb', line 41 def self. @@to_db_options end |