-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove state machine gem from Spree::Reimbursement
The state machine is a problem for a few reasons: transitions are hard to understand and debug, transition order is tough to control, and database transactions during a transition aren't well understood. Removing it brings increased code clarity, as well as the ability to more easily extend the functionality that was previously hidden by the state machine.
- Loading branch information
Showing
3 changed files
with
193 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
core/db/migrate/20180404235352_add_default_status_to_reimbursements.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddDefaultStatusToReimbursements < ActiveRecord::Migration[5.1] | ||
def change | ||
change_column_default(:spree_reimbursements, :reimbursement_status, 'pending') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters