Skip to content

Commit

Permalink
update all instances of "@behaviour Ecto.Type" to "use Ecto.Type" #76…
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Sep 13, 2020
1 parent 62cee4b commit 473cb50
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 39 deletions.
3 changes: 1 addition & 2 deletions lib/address.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ defmodule Fields.Address do
```
"""
alias Fields.Validate

@behaviour Ecto.Type
use Ecto.Type

def type, do: :string

Expand Down
3 changes: 1 addition & 2 deletions lib/address_encrypted.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ defmodule Fields.AddressEncrypted do
end
"""
alias Fields.{Address, Encrypted}

@behaviour Ecto.Type
use Ecto.Type

def type, do: :binary

Expand Down
3 changes: 2 additions & 1 deletion lib/aes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ defmodule Fields.AES do
|> String.replace("'", "")
#  split the CSV list of keys
|> String.split(",")
|> IO.inspect()
# decode the keys
|> Enum.map(fn key -> :base64.decode(key) end)
|> Enum.map(fn key -> :base64.decode(to_string(key)) end)
@doc """
Encrypt Using AES Galois/Counter Mode (GCM)
https://en.wikipedia.org/wiki/Galois/Counter_Mode
Expand Down
2 changes: 1 addition & 1 deletion lib/description_plaintext_unlimited.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule Fields.DescriptionPlaintextUnlimited do
field(:description, Fields.DescriptionPlaintextUnlimited)
end
"""
@behaviour Ecto.Type
use Ecto.Type

def type, do: :string

Expand Down
3 changes: 1 addition & 2 deletions lib/email_encrypted.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ defmodule Fields.EmailEncrypted do
end
"""
alias Fields.{EmailPlaintext, Encrypted}

@behaviour Ecto.Type
use Ecto.Type

def type, do: :binary

Expand Down
3 changes: 1 addition & 2 deletions lib/email_hash.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ defmodule Fields.EmailHash do
end
"""
alias Fields.{EmailPlaintext, Hash}

@behaviour Ecto.Type
use Ecto.Type

def type, do: :binary

Expand Down
3 changes: 1 addition & 2 deletions lib/email_plaintext.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ defmodule Fields.EmailPlaintext do
end
"""
alias Fields.Validate

@behaviour Ecto.Type
use Ecto.Type

def type, do: :string

Expand Down
3 changes: 1 addition & 2 deletions lib/encrypted.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ defmodule Fields.Encrypted do
end
"""
alias Fields.AES

@behaviour Ecto.Type
use Ecto.Type
def type, do: :binary

def cast(value) do
Expand Down
3 changes: 1 addition & 2 deletions lib/hash.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ defmodule Fields.Hash do
field(:digest, Fields.Hash)
end
"""
@behaviour Ecto.Type

use Ecto.Type
alias Fields.Helpers

def type, do: :binary
Expand Down
2 changes: 1 addition & 1 deletion lib/html-body.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Fields.HtmlBody do
field(:body, Fields.HtmlBody)
end
"""
@behaviour Ecto.Type
use Ecto.Type

def type, do: :string

Expand Down
3 changes: 1 addition & 2 deletions lib/ip_address_encrypted.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ defmodule Fields.IpAddressEncrypted do
end
"""
alias Fields.{IpAddressPlaintext, Encrypted}

@behaviour Ecto.Type
use Ecto.Type

def type, do: :binary

Expand Down
3 changes: 1 addition & 2 deletions lib/ip_address_hash.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ defmodule Fields.IpAddressHash do
end
"""
alias Fields.{IpAddressPlaintext, Hash}

@behaviour Ecto.Type
use Ecto.Type

def type, do: :binary

Expand Down
3 changes: 1 addition & 2 deletions lib/ip_address_plaintext.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ defmodule Fields.IpAddressPlaintext do
end
"""
alias Fields.Validate

@behaviour Ecto.Type
use Ecto.Type

def type, do: :string

Expand Down
3 changes: 1 addition & 2 deletions lib/name.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ defmodule Fields.Name do
```
"""
alias Fields.{Validate, Encrypted}

@behaviour Ecto.Type
use Ecto.Type

def type, do: :binary

Expand Down
3 changes: 1 addition & 2 deletions lib/password.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ defmodule Fields.Password do
field(:password, Fields.Password)
end
"""
@behaviour Ecto.Type

use Ecto.Type
alias Fields.Helpers

def type, do: :binary
Expand Down
3 changes: 1 addition & 2 deletions lib/phone_number.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ defmodule Fields.PhoneNumber do
end
"""
alias Fields.Validate

@behaviour Ecto.Type
use Ecto.Type

def type, do: :string

Expand Down
3 changes: 1 addition & 2 deletions lib/phone_number_encrypted.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ defmodule Fields.PhoneNumberEncrypted do
end
"""
alias Fields.{PhoneNumber, Encrypted}

@behaviour Ecto.Type
use Ecto.Type

def type, do: :binary

Expand Down
3 changes: 1 addition & 2 deletions lib/postcode.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ defmodule Fields.Postcode do
end
"""
alias Fields.Validate

@behaviour Ecto.Type
use Ecto.Type

def type, do: :string

Expand Down
3 changes: 1 addition & 2 deletions lib/postcode_encrypted.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ defmodule Fields.PostcodeEncrypted do
end
"""
alias Fields.{Postcode, Encrypted}

@behaviour Ecto.Type
use Ecto.Type

def type, do: :binary

Expand Down
3 changes: 1 addition & 2 deletions lib/url.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ defmodule Fields.Url do
end
"""
alias Fields.Validate

@behaviour Ecto.Type
use Ecto.Type

def type, do: :string

Expand Down
3 changes: 1 addition & 2 deletions lib/url_encrypted.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ defmodule Fields.UrlEncrypted do
```
"""
alias Fields.{Validate, Encrypted}

@behaviour Ecto.Type
use Ecto.Type

def type, do: :binary

Expand Down

0 comments on commit 473cb50

Please sign in to comment.