Skip to content

Commit

Permalink
fix: both risk and its status machine should have the same default va…
Browse files Browse the repository at this point in the history
…lue to avoid inconsistencies
  • Loading branch information
xel1045 committed Jun 11, 2024
1 parent e01696b commit 100c20d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions db/migrate/003_change_default_risk_status.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
migration_class = ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[4.2] : ActiveRecord::Migration

class ChangeDefaultRiskStatus < migration_class
def change
# Both Risk and its :status machine should have the same default value to avoid inconsistencies
change_column_default(:risks, :status, from: "opened", to: "open")
end
end

0 comments on commit 100c20d

Please sign in to comment.