Class: ActiveRecord::Migration::Current

Inherits:
ActiveRecord::Migration show all
Defined in:
lib/active_record/migration.rb

Overview

This must be defined before the inherited hook, below

Direct Known Subclasses

Schema

Constant Summary

Constants inherited from ActiveRecord::Migration

MigrationFilenameRegexp

Instance Attribute Summary

Attributes inherited from ActiveRecord::Migration

#name, #version

Instance Method Summary collapse

Methods inherited from ActiveRecord::Migration

[], #announce, check_pending!, #connection, #copy, current_version, #disable_ddl_transaction, disable_ddl_transaction!, #down, #exec_migration, inherited, #initialize, load_schema_if_pending!, maintain_test_schema!, method_missing, #method_missing, migrate, #migrate, nearest_delegate, #next_migration_number, #proper_table_name, #reversible, #revert, #reverting?, #run, #say, #say_with_time, #suppress_messages, #table_name_options, #up, #up_only, #write

Constructor Details

This class inherits a constructor from ActiveRecord::Migration

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveRecord::Migration

Instance Method Details

#change_table(table_name, **options) ⇒ Object



562
563
564
565
566
567
568
# File 'lib/active_record/migration.rb', line 562

def change_table(table_name, **options)
  if block_given?
    super { |t| yield compatible_table_definition(t) }
  else
    super
  end
end

#compatible_table_definition(t) ⇒ Object



586
587
588
# File 'lib/active_record/migration.rb', line 586

def compatible_table_definition(t)
  t
end

#create_join_table(table_1, table_2, **options) ⇒ Object



570
571
572
573
574
575
576
# File 'lib/active_record/migration.rb', line 570

def create_join_table(table_1, table_2, **options)
  if block_given?
    super { |t| yield compatible_table_definition(t) }
  else
    super
  end
end

#create_table(table_name, **options) ⇒ Object

:nodoc:



554
555
556
557
558
559
560
# File 'lib/active_record/migration.rb', line 554

def create_table(table_name, **options)
  if block_given?
    super { |t| yield compatible_table_definition(t) }
  else
    super
  end
end

#drop_table(table_name, **options) ⇒ Object



578
579
580
581
582
583
584
# File 'lib/active_record/migration.rb', line 578

def drop_table(table_name, **options)
  if block_given?
    super { |t| yield compatible_table_definition(t) }
  else
    super
  end
end