Skip to content

Commit

Permalink
Fixed safety_assured for custom checks with safe_by_default - fixes #236
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Aug 9, 2023
1 parent 4ea84af commit ef8d306
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.6.1 (unreleased)

- Fixed `safety_assured` for custom checks with `safe_by_default`

## 1.6.0 (2023-07-22)

- Added check for `change_column_default`
Expand Down
8 changes: 5 additions & 3 deletions lib/strong_migrations/checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ def perform(method, *args)
@committed = true
end

# custom checks
StrongMigrations.checks.each do |check|
@migration.instance_exec(method, args, &check)
if !safe?
# custom checks
StrongMigrations.checks.each do |check|
@migration.instance_exec(method, args, &check)
end
end
end

Expand Down

0 comments on commit ef8d306

Please sign in to comment.