Skip to content

Commit

Permalink
[Change] format schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
albertored committed Jun 24, 2020
1 parent 52d83b5 commit 1692e90
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
4 changes: 3 additions & 1 deletion .formatter.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
inputs: [
"lib/**/*.{ex,exs}",
"test/**/*.{ex,exs}",
"priv/**/*.{ex,exs}",
"mix.exs"
],
line_length: 120
line_length: 120,
import_deps: [:ecto]
]
6 changes: 3 additions & 3 deletions test/support/comment.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ defmodule ExSieve.Comment do
use Ecto.Schema

schema "comments" do
belongs_to(:post, ExSieve.Post)
belongs_to(:user, ExSieve.User)
belongs_to :post, ExSieve.Post
belongs_to :user, ExSieve.User

field(:body)
field :body

timestamps()
end
Expand Down
12 changes: 6 additions & 6 deletions test/support/post.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ defmodule ExSieve.Post do
use Ecto.Schema

schema "posts" do
has_many(:comments, ExSieve.Comment)
belongs_to(:user, ExSieve.User)
has_many :comments, ExSieve.Comment
belongs_to :user, ExSieve.User

field(:title)
field(:body)
field(:published, :boolean)
field(:published_at, :naive_datetime)
field :title
field :body
field :published, :boolean
field :published_at, :naive_datetime

timestamps()
end
Expand Down
8 changes: 4 additions & 4 deletions test/support/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ defmodule ExSieve.User do
use Ecto.Schema

schema "users" do
has_many(:comments, ExSieve.Comment)
has_many(:posts, ExSieve.Post)
has_many :comments, ExSieve.Comment
has_many :posts, ExSieve.Post

field(:name)
field(:cash, Money.Ecto.Type)
field :name
field :cash, Money.Ecto.Type

timestamps()
end
Expand Down

0 comments on commit 1692e90

Please sign in to comment.