-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: support
:ci_string
as a storage_type
- Loading branch information
1 parent
772c12b
commit 9f62d65
Showing
4 changed files
with
20 additions
and
19 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
defmodule Ash.Type.StringWrapper do | ||
defmodule Ash.Type.CiStringWrapper do | ||
@moduledoc false | ||
use Ash.Type | ||
|
||
@impl true | ||
def storage_type(_), do: :text | ||
def storage_type(_), do: :citext | ||
|
||
@impl true | ||
defdelegate cast_input(value, constraints), to: Ash.Type.String | ||
defdelegate cast_input(value, constraints), to: Ash.Type.CiString | ||
@impl true | ||
defdelegate cast_stored(value, constraints), to: Ash.Type.String | ||
defdelegate cast_stored(value, constraints), to: Ash.Type.CiString | ||
@impl true | ||
defdelegate dump_to_native(value, constraints), to: Ash.Type.String | ||
defdelegate dump_to_native(value, constraints), to: Ash.Type.CiString | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
defmodule Ash.Type.StringWrapper do | ||
@moduledoc false | ||
use Ash.Type | ||
|
||
@impl true | ||
def storage_type(_), do: :text | ||
|
||
@impl true | ||
defdelegate cast_input(value, constraints), to: Ash.Type.String | ||
@impl true | ||
defdelegate cast_stored(value, constraints), to: Ash.Type.String | ||
@impl true | ||
defdelegate dump_to_native(value, constraints), to: Ash.Type.String | ||
end |