Module: ZeroDowntimeMigrations::Migration
- Extended by:
- DSL
- Defined in:
- lib/zero_downtime_migrations/migration.rb
Instance Attribute Summary
Attributes included from DSL
#current, #data, #ddl, #index, #safe
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from DSL
data?, ddl?, index?, migrating?, mixed?, safe?, unsafe?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
79
80
81
82
83
84
|
# File 'lib/zero_downtime_migrations/migration.rb', line 79
def method_missing(method, *args)
Migration.ddl = true if ddl_method?(method)
Migration.index = true if index_method?(method)
validate(method, *args)
super
end
|
Class Method Details
.prepended(mod) ⇒ Object
5
6
7
|
# File 'lib/zero_downtime_migrations/migration.rb', line 5
def self.prepended(mod)
mod.singleton_class.prepend(DSL)
end
|
Instance Method Details
#ddl_disabled? ⇒ Boolean
15
16
17
|
# File 'lib/zero_downtime_migrations/migration.rb', line 15
def ddl_disabled?
!!disable_ddl_transaction
end
|
#initialize ⇒ Object
9
10
11
12
13
|
# File 'lib/zero_downtime_migrations/migration.rb', line 9
def initialize(*)
ActiveRecord::Base.send(:prepend, Data)
ActiveRecord::Relation.send(:prepend, Relation)
super
end
|
#migrate(direction) ⇒ Object