This repository has been archived by the owner on Jan 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
314edf6
commit 7ffc4ab
Showing
7 changed files
with
52 additions
and
2 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
9 changes: 9 additions & 0 deletions
9
services/app/lib/hexlet_basics/state_machines/user/email_delivery_state_machine.ex
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,9 @@ | ||
defmodule HexletBasics.StateMachines.User.EmailDeliveryStateMachine do | ||
use Machinery, | ||
field: :email_delivery_state, | ||
states: ["enabled", "disabled"], | ||
transitions: %{ | ||
"enabled" => "disabled", | ||
"disabled" => "enabled" | ||
} | ||
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
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
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
9 changes: 9 additions & 0 deletions
9
services/app/priv/repo/migrations/20190911072227_add_email_delivery_state_to_user.exs
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,9 @@ | ||
defmodule HexletBasics.Repo.Migrations.AddEmailDeliveryStateToUser do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:users) do | ||
add :email_delivery_state, :string | ||
end | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
services/app/priv/repo/migrations/20190911072926_migrate_email_deliviery_state_for_user.exs
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 @@ | ||
defmodule HexletBasics.Repo.Migrations.MigrateEmailDelivieryStateForUser do | ||
use Ecto.Migration | ||
|
||
def change do | ||
HexletBasics.Repo.update_all(HexletBasics.User, set: [email_delivery_state: "enabled"]) | ||
end | ||
end |