Skip to content

Instantly share code, notes, and snippets.

@stochastic-thread
Created November 28, 2015 22:01
Show Gist options
  • Save stochastic-thread/2296bf451fdafd7c8e44 to your computer and use it in GitHub Desktop.
Save stochastic-thread/2296bf451fdafd7c8e44 to your computer and use it in GitHub Desktop.
Ecto Changeset issue
{:error,
%Ecto.Changeset{action: nil,
changes: %{address_city: "", address_line_1: "401 Nina Place",
address_line_2: "", address_state: "", address_zip: "20852",
crypted_password: "$2b$12$whvz5KJaQQquZG4CSb1f2.Krm0K0/eiQw8.sRLi.FI6/s4FGxQYzu",
email: "qq@qq.com", home: "401 Nina Place, 20852", name: "Quentin QQ",
phone_number: ""},
constraints: [%{constraint: "users_email_index", field: :email,
message: "has already been taken", type: :unique}],
errors: [latitude: "is invalid", longitude: "is invalid",
crypted_password: "can't be blank"], filters: %{},
model: %Trophus.User{__meta__: #Ecto.Schema.Metadata<:built>,
address_city: nil, address_line_1: nil, address_line_2: nil,
address_state: nil, address_zip: nil, bio: nil, connect_id: nil,
crypted_password: nil, current_order: nil, customer_id: nil,
dishes: #Ecto.Association.NotLoaded<association :dishes is not loaded>,
email: nil, home: nil, id: nil, inserted_at: nil, instagram_token: nil,
latitude: nil, longitude: nil, name: nil,
orders: #Ecto.Association.NotLoaded<association :orders is not loaded>,
phone_number: nil, publishable_key: nil, secret_key: nil, unread: 0,
updated_at: nil, username: nil},
optional: [:unread, :name, :bio, :current_order, :username, :latitude,
:instagram_token, :longitude, :home, :phone_number, :address_line_1,
:address_line_2, :address_state, :address_city, :address_zip, :customer_id,
:publishable_key, :secret_key, :connect_id], opts: [],
params: %{"address_city" => "", "address_line_1" => "401 Nina Place",
"address_line_2" => "", "address_state" => "", "address_zip" => "20852",
"email" => "qq@qq.com", "home" => "401 Nina Place, 20852",
"latitude" => "", "longitude" => "", "name" => "Quentin QQ",
"password" => "password", "phone_number" => ""}, repo: nil,
required: [:email, :crypted_password],
types: %{address_city: :string, address_line_1: :string,
address_line_2: :string, address_state: :string, address_zip: :string,
bio: :string, connect_id: :string, crypted_password: :string,
current_order: :integer, customer_id: :string,
dishes: {:assoc,
%Ecto.Association.Has{cardinality: :many, defaults: [], field: :dishes,
on_cast: :changeset, on_delete: :nothing, on_replace: :raise,
owner: Trophus.User, owner_key: :id, queryable: Trophus.Dish,
related: Trophus.Dish, related_key: :user_id}}, email: :string,
home: :string, id: :id, inserted_at: Ecto.DateTime,
instagram_token: :string, latitude: :float, longitude: :float,
name: :string,
orders: {:assoc,
%Ecto.Association.Has{cardinality: :many, defaults: [], field: :orders,
on_cast: :changeset, on_delete: :nothing, on_replace: :raise,
owner: Trophus.User, owner_key: :id, queryable: Trophus.Order,
related: Trophus.Order, related_key: :user_id}}, phone_number: :string,
publishable_key: :string, secret_key: :string, unread: :integer,
updated_at: Ecto.DateTime, username: :string}, valid?: false,
validations: [email: {:format, ~r/@/}]}}
[info] Sent 302 in 529ms
Compiled web/controllers/conversation_controller.ex
Compiled web/models/relation_backup.ex
[info] GET /
[debug] Processing by Trophus.PageController.index/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment