Skip to content

Commit

Permalink
Removed unneeded checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Nov 7, 2024
1 parent eafbf0a commit 9937ffd
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions lib/strong_migrations/safe_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,15 @@ def safe_change_column_null(add_code, validate_code, change_args, remove_code, d
disable_transaction
@migration.execute(validate_code)
end
if change_args
@migration.change_column_null(*change_args)
@migration.safety_assured do
@migration.execute(remove_code)
end
@migration.change_column_null(*change_args)
@migration.safety_assured do
@migration.execute(remove_code)
end
end
dir.down do
if change_args
down_args = change_args.dup
down_args[2] = true
@migration.change_column_null(*down_args)
else
@migration.safety_assured do
@migration.execute(remove_code)
end
end
down_args = change_args.dup
down_args[2] = true
@migration.change_column_null(*down_args)
end
end
end
Expand Down

0 comments on commit 9937ffd

Please sign in to comment.