rename on_remove, on_drop

This commit is contained in:
Sam
2017-05-04 13:41:05 -04:00
parent 81326f85e5
commit 7a15b44ac3
6 changed files with 8 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
class ColumnDropper
def self.drop(table:, after_migration:, columns:, delay: nil, on_remove: nil)
def self.drop(table:, after_migration:, columns:, delay: nil, on_drop: nil)
raise ArgumentError.new("Invalid table name passed to drop #{table}") if table =~ /[^a-z0-9_]/i
columns.each do |column|
@@ -27,7 +27,7 @@ SQL
columns: columns,
delay: "#{delay.to_i || 0} seconds",
after_migration: after_migration).to_a.length > 0
on_remove&.call
on_drop&.call
columns.each do |column|
# safe cause it is protected on method entry, can not be passed in params