{"action":"created","comment":{"url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/comments/69340248","id":69340248,"diff_hunk":"@@ -214,24 +214,18 @@ defmodule HelloPhoenix.User do\n     field :bio, :string\n     field :number_of_pets, :integer\n \n-    timestamps\n+    timestamps()\n   end\n \n-  @required_fields ~w(name email bio number_of_pets)\n-  @optional_fields ~w()\n-\n   @doc \"\"\"\n-  Creates a changeset based on the `model` and `params`.\n-\n-  If no params are provided, an invalid changeset is returned\n-  with no validation performed.\n+  Builds a changeset based on the `struct` and `params`.\n   \"\"\"\n-  def changeset(model, params \\\\ :empty) do\n-    model\n-    |> cast(params, @required_fields, @optional_fields)\n+  def changeset(struct, params \\\\ %{}) do\n+    struct\n+    |> cast(params, [:name, :email, :bio, :number_of_pets])","path":"H_ecto_models.md","position":23,"original_position":23,"commit_id":"06b7cdfd153f1d5a9f459e1539f652a42f3a1fe9","original_commit_id":"06b7cdfd153f1d5a9f459e1539f652a42f3a1fe9","user":{"login":"ybur-yug","id":4298745,"avatar_url":"https://avatars.githubusercontent.com/u/4298745?v=3","gravatar_id":"","url":"https://api.github.com/users/ybur-yug","html_url":"https://github.com/ybur-yug","followers_url":"https://api.github.com/users/ybur-yug/followers","following_url":"https://api.github.com/users/ybur-yug/following{/other_user}","gists_url":"https://api.github.com/users/ybur-yug/gists{/gist_id}","starred_url":"https://api.github.com/users/ybur-yug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybur-yug/subscriptions","organizations_url":"https://api.github.com/users/ybur-yug/orgs","repos_url":"https://api.github.com/users/ybur-yug/repos","events_url":"https://api.github.com/users/ybur-yug/events{/privacy}","received_events_url":"https://api.github.com/users/ybur-yug/received_events","type":"User","site_admin":false},"body":"I guess maybe going into how these two work in conjunction with `schema` might be of benefit here, but the terminology is so clear that its pretty implicitly easy to understand. Thoughts, anyone?","created_at":"2016-07-01T18:39:25Z","updated_at":"2016-07-01T18:39:25Z","html_url":"https://github.com/phoenixframework/phoenix_guides/pull/534#discussion_r69340248","pull_request_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/534","_links":{"self":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/comments/69340248"},"html":{"href":"https://github.com/phoenixframework/phoenix_guides/pull/534#discussion_r69340248"},"pull_request":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/534"}}},"pull_request":{"url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/534","id":76018520,"html_url":"https://github.com/phoenixframework/phoenix_guides/pull/534","diff_url":"https://github.com/phoenixframework/phoenix_guides/pull/534.diff","patch_url":"https://github.com/phoenixframework/phoenix_guides/pull/534.patch","issue_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/534","number":534,"state":"open","locked":false,"title":"Model Guide Updates (Phoenix 1.2)","user":{"login":"ybur-yug","id":4298745,"avatar_url":"https://avatars.githubusercontent.com/u/4298745?v=3","gravatar_id":"","url":"https://api.github.com/users/ybur-yug","html_url":"https://github.com/ybur-yug","followers_url":"https://api.github.com/users/ybur-yug/followers","following_url":"https://api.github.com/users/ybur-yug/following{/other_user}","gists_url":"https://api.github.com/users/ybur-yug/gists{/gist_id}","starred_url":"https://api.github.com/users/ybur-yug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybur-yug/subscriptions","organizations_url":"https://api.github.com/users/ybur-yug/orgs","repos_url":"https://api.github.com/users/ybur-yug/repos","events_url":"https://api.github.com/users/ybur-yug/events{/privacy}","received_events_url":"https://api.github.com/users/ybur-yug/received_events","type":"User","site_admin":false},"body":"# Model Guide Updates (Phoenix 1.2)\r\nIn relation to #532 I had some time this Friday to dive into this for work. I plan on getting through the whole model guide today, and just figured I'd throw this up for discussion as it goes on.\r\n\r\n## Process\r\nI took a pretty simple process to go through.\r\n\r\nFirst I just generated a new project after making sure I had Phoenix 1.2/Elixir 1.3 installed. From here, I followed step by step and just updated all code and changes that I saw. There were several issues open that were essentially the changes needed to this guide as a blanket, as well as a few others I saw.\r\n\r\n## Issues referenced:\r\n\r\n- [x] [529](https://github.com/phoenixframework/phoenix_guides/issues/529)\r\n- [x] [530](https://github.com/phoenixframework/phoenix_guides/issues/530)\r\n- [x] [531](https://github.com/phoenixframework/phoenix_guides/issues/531)","created_at":"2016-07-01T18:21:42Z","updated_at":"2016-07-01T18:39:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2659e2d21bd956037e8d688d2e032170e2fb45d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/534/commits","review_comments_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/534/comments","review_comment_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/534/comments","statuses_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/statuses/06b7cdfd153f1d5a9f459e1539f652a42f3a1fe9","head":{"label":"cometaworks:update/model_guide_updates_1.2","ref":"update/model_guide_updates_1.2","sha":"06b7cdfd153f1d5a9f459e1539f652a42f3a1fe9","user":{"login":"cometaworks","id":1832487,"avatar_url":"https://avatars.githubusercontent.com/u/1832487?v=3","gravatar_id":"","url":"https://api.github.com/users/cometaworks","html_url":"https://github.com/cometaworks","followers_url":"https://api.github.com/users/cometaworks/followers","following_url":"https://api.github.com/users/cometaworks/following{/other_user}","gists_url":"https://api.github.com/users/cometaworks/gists{/gist_id}","starred_url":"https://api.github.com/users/cometaworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cometaworks/subscriptions","organizations_url":"https://api.github.com/users/cometaworks/orgs","repos_url":"https://api.github.com/users/cometaworks/repos","events_url":"https://api.github.com/users/cometaworks/events{/privacy}","received_events_url":"https://api.github.com/users/cometaworks/received_events","type":"Organization","site_admin":false},"repo":{"id":62410252,"name":"phoenix_guides","full_name":"cometaworks/phoenix_guides","owner":{"login":"cometaworks","id":1832487,"avatar_url":"https://avatars.githubusercontent.com/u/1832487?v=3","gravatar_id":"","url":"https://api.github.com/users/cometaworks","html_url":"https://github.com/cometaworks","followers_url":"https://api.github.com/users/cometaworks/followers","following_url":"https://api.github.com/users/cometaworks/following{/other_user}","gists_url":"https://api.github.com/users/cometaworks/gists{/gist_id}","starred_url":"https://api.github.com/users/cometaworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cometaworks/subscriptions","organizations_url":"https://api.github.com/users/cometaworks/orgs","repos_url":"https://api.github.com/users/cometaworks/repos","events_url":"https://api.github.com/users/cometaworks/events{/privacy}","received_events_url":"https://api.github.com/users/cometaworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cometaworks/phoenix_guides","description":"User guides for the Phoenix web development framework.","fork":true,"url":"https://api.github.com/repos/cometaworks/phoenix_guides","forks_url":"https://api.github.com/repos/cometaworks/phoenix_guides/forks","keys_url":"https://api.github.com/repos/cometaworks/phoenix_guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cometaworks/phoenix_guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cometaworks/phoenix_guides/teams","hooks_url":"https://api.github.com/repos/cometaworks/phoenix_guides/hooks","issue_events_url":"https://api.github.com/repos/cometaworks/phoenix_guides/issues/events{/number}","events_url":"https://api.github.com/repos/cometaworks/phoenix_guides/events","assignees_url":"https://api.github.com/repos/cometaworks/phoenix_guides/assignees{/user}","branches_url":"https://api.github.com/repos/cometaworks/phoenix_guides/branches{/branch}","tags_url":"https://api.github.com/repos/cometaworks/phoenix_guides/tags","blobs_url":"https://api.github.com/repos/cometaworks/phoenix_guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cometaworks/phoenix_guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cometaworks/phoenix_guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/cometaworks/phoenix_guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cometaworks/phoenix_guides/statuses/{sha}","languages_url":"https://api.github.com/repos/cometaworks/phoenix_guides/languages","stargazers_url":"https://api.github.com/repos/cometaworks/phoenix_guides/stargazers","contributors_url":"https://api.github.com/repos/cometaworks/phoenix_guides/contributors","subscribers_url":"https://api.github.com/repos/cometaworks/phoenix_guides/subscribers","subscription_url":"https://api.github.com/repos/cometaworks/phoenix_guides/subscription","commits_url":"https://api.github.com/repos/cometaworks/phoenix_guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/cometaworks/phoenix_guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/cometaworks/phoenix_guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/cometaworks/phoenix_guides/issues/comments{/number}","contents_url":"https://api.github.com/repos/cometaworks/phoenix_guides/contents/{+path}","compare_url":"https://api.github.com/repos/cometaworks/phoenix_guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cometaworks/phoenix_guides/merges","archive_url":"https://api.github.com/repos/cometaworks/phoenix_guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cometaworks/phoenix_guides/downloads","issues_url":"https://api.github.com/repos/cometaworks/phoenix_guides/issues{/number}","pulls_url":"https://api.github.com/repos/cometaworks/phoenix_guides/pulls{/number}","milestones_url":"https://api.github.com/repos/cometaworks/phoenix_guides/milestones{/number}","notifications_url":"https://api.github.com/repos/cometaworks/phoenix_guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cometaworks/phoenix_guides/labels{/name}","releases_url":"https://api.github.com/repos/cometaworks/phoenix_guides/releases{/id}","deployments_url":"https://api.github.com/repos/cometaworks/phoenix_guides/deployments","created_at":"2016-07-01T17:48:55Z","updated_at":"2016-07-01T17:48:56Z","pushed_at":"2016-07-01T18:35:59Z","git_url":"git://github.com/cometaworks/phoenix_guides.git","ssh_url":"git@github.com:cometaworks/phoenix_guides.git","clone_url":"https://github.com/cometaworks/phoenix_guides.git","svn_url":"https://github.com/cometaworks/phoenix_guides","homepage":null,"size":1911,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"phoenixframework:master","ref":"master","sha":"cfd3b98337bb948fcad1baa3effeb926154b0eae","user":{"login":"phoenixframework","id":6510388,"avatar_url":"https://avatars.githubusercontent.com/u/6510388?v=3","gravatar_id":"","url":"https://api.github.com/users/phoenixframework","html_url":"https://github.com/phoenixframework","followers_url":"https://api.github.com/users/phoenixframework/followers","following_url":"https://api.github.com/users/phoenixframework/following{/other_user}","gists_url":"https://api.github.com/users/phoenixframework/gists{/gist_id}","starred_url":"https://api.github.com/users/phoenixframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phoenixframework/subscriptions","organizations_url":"https://api.github.com/users/phoenixframework/orgs","repos_url":"https://api.github.com/users/phoenixframework/repos","events_url":"https://api.github.com/users/phoenixframework/events{/privacy}","received_events_url":"https://api.github.com/users/phoenixframework/received_events","type":"Organization","site_admin":false},"repo":{"id":22436876,"name":"phoenix_guides","full_name":"phoenixframework/phoenix_guides","owner":{"login":"phoenixframework","id":6510388,"avatar_url":"https://avatars.githubusercontent.com/u/6510388?v=3","gravatar_id":"","url":"https://api.github.com/users/phoenixframework","html_url":"https://github.com/phoenixframework","followers_url":"https://api.github.com/users/phoenixframework/followers","following_url":"https://api.github.com/users/phoenixframework/following{/other_user}","gists_url":"https://api.github.com/users/phoenixframework/gists{/gist_id}","starred_url":"https://api.github.com/users/phoenixframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phoenixframework/subscriptions","organizations_url":"https://api.github.com/users/phoenixframework/orgs","repos_url":"https://api.github.com/users/phoenixframework/repos","events_url":"https://api.github.com/users/phoenixframework/events{/privacy}","received_events_url":"https://api.github.com/users/phoenixframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phoenixframework/phoenix_guides","description":"User guides for the Phoenix web development framework.","fork":false,"url":"https://api.github.com/repos/phoenixframework/phoenix_guides","forks_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/forks","keys_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/teams","hooks_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/hooks","issue_events_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/events{/number}","events_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/events","assignees_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/assignees{/user}","branches_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/branches{/branch}","tags_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/tags","blobs_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/statuses/{sha}","languages_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/languages","stargazers_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/stargazers","contributors_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/contributors","subscribers_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/subscribers","subscription_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/subscription","commits_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/comments{/number}","contents_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/contents/{+path}","compare_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/merges","archive_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/downloads","issues_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues{/number}","pulls_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls{/number}","milestones_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/milestones{/number}","notifications_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/labels{/name}","releases_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/releases{/id}","deployments_url":"https://api.github.com/repos/phoenixframework/phoenix_guides/deployments","created_at":"2014-07-30T17:00:36Z","updated_at":"2016-06-26T02:57:13Z","pushed_at":"2016-07-01T18:35:59Z","git_url":"git://github.com/phoenixframework/phoenix_guides.git","ssh_url":"git@github.com:phoenixframework/phoenix_guides.git","clone_url":"https://github.com/phoenixframework/phoenix_guides.git","svn_url":"https://github.com/phoenixframework/phoenix_guides","homepage":null,"size":1911,"stargazers_count":353,"watchers_count":353,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":200,"mirror_url":null,"open_issues_count":33,"forks":200,"open_issues":33,"watchers":353,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/534"},"html":{"href":"https://github.com/phoenixframework/phoenix_guides/pull/534"},"issue":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/534"},"comments":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/issues/534/comments"},"review_comments":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/534/comments"},"review_comment":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/pulls/534/commits"},"statuses":{"href":"https://api.github.com/repos/phoenixframework/phoenix_guides/statuses/06b7cdfd153f1d5a9f459e1539f652a42f3a1fe9"}}}}
{"actor":{"display_login":"ybur-yug"}}