Module: StrongMigrations::Migration
- Defined in:
- lib/strong_migrations/migration.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
8
9
10
11
12
|
# File 'lib/strong_migrations/migration.rb', line 8
def method_missing(method, *args)
strong_migrations_checker.perform(method, *args) do
super
end
end
|
Instance Method Details
#migrate(direction) ⇒ Object
3
4
5
6
|
# File 'lib/strong_migrations/migration.rb', line 3
def migrate(direction)
strong_migrations_checker.direction = direction
super
end
|
#safety_assured ⇒ Object
14
15
16
17
18
|
# File 'lib/strong_migrations/migration.rb', line 14
def safety_assured
strong_migrations_checker.safety_assured do
yield
end
end
|
#stop!(message, header: "Custom check") ⇒ Object
20
21
22
|
# File 'lib/strong_migrations/migration.rb', line 20
def stop!(message, header: "Custom check")
raise StrongMigrations::UnsafeMigration, "\n=== #{} #strong_migrations ===\n\n#{message}\n"
end
|