Class: SM::SuperMigration

Inherits:
Object
  • Object
show all
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

Class Method Details

.current_recordObject



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_fromObject



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_toObject



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(options = {})
  return if options.size < 4
  @@from_db_options = options.dup
end

.from_db_optionsObject



37
38
39
# File 'lib/super_migration.rb', line 37

def self.from_db_options
  @@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(options = {})
  return if options.size < 4
  @@to_db_options = options.dup
end

.to_db_optionsObject



41
42
43
# File 'lib/super_migration.rb', line 41

def self.to_db_options
  @@to_db_options
end