Skip to content

Commit

Permalink
Pluralize Preferences again
Browse files Browse the repository at this point in the history
  • Loading branch information
abshierjoel committed Oct 4, 2021
1 parent cc8e857 commit 0be09ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule UserPreferences.Preference do
defmodule UserPreferences.Preferences do
use Ecto.Schema
import Ecto.Changeset

Expand All @@ -11,9 +11,9 @@ defmodule UserPreferences.Preference do
end

@doc false
def changeset(preference, attrs) do
preference
|> cast(attrs, [:likes_emails, :likes_phone_calls])
|> validate_required([:likes_emails, :likes_phone_calls])
def changeset(preferences, attrs) do
preferences
|> cast(attrs, [:likes_emails, :likes_phone_calls, :user_id])
|> validate_required([:likes_emails, :likes_phone_calls, :user_id])
end
end
2 changes: 1 addition & 1 deletion lib/gql_preferences/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule UserPreferences.User do
schema "users" do
field :email, :string
field :name, :string
has_one :preference, UserPreferences.Preference
has_one :preferences, UserPreferences.Preferences

timestamps()
end
Expand Down

0 comments on commit 0be09ba

Please sign in to comment.