From 9937ffd3ff9b201160548fe26d5a856ace7e1b5e Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Wed, 6 Nov 2024 19:51:49 -0800 Subject: [PATCH] Removed unneeded checks --- lib/strong_migrations/safe_methods.rb | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/lib/strong_migrations/safe_methods.rb b/lib/strong_migrations/safe_methods.rb index 5c00b451..2ee81f20 100644 --- a/lib/strong_migrations/safe_methods.rb +++ b/lib/strong_migrations/safe_methods.rb @@ -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