{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-lang/ecto/pulls/comments/39351660","id":39351660,"diff_hunk":"@@ -252,6 +251,27 @@ defmodule Ecto.Changeset.Relation do\n     Changeset.change(current, changes) |> put_new_action(:update)\n   end\n \n+  @doc \"\"\"\n+  TODO\n+  \"\"\"\n+  def on_replace(%{on_replace: :mark_as_invalid}, changeset_or_model) do\n+    %{Changeset.change(changeset_or_model) | valid?: false}","path":"lib/ecto/changeset/relation.ex","position":50,"original_position":50,"commit_id":"744790493167f5847ad0b3553273ce4872723672","original_commit_id":"744790493167f5847ad0b3553273ce4872723672","user":{"login":"michalmuskala","id":477062,"avatar_url":"https://avatars.githubusercontent.com/u/477062?v=3","gravatar_id":"","url":"https://api.github.com/users/michalmuskala","html_url":"https://github.com/michalmuskala","followers_url":"https://api.github.com/users/michalmuskala/followers","following_url":"https://api.github.com/users/michalmuskala/following{/other_user}","gists_url":"https://api.github.com/users/michalmuskala/gists{/gist_id}","starred_url":"https://api.github.com/users/michalmuskala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalmuskala/subscriptions","organizations_url":"https://api.github.com/users/michalmuskala/orgs","repos_url":"https://api.github.com/users/michalmuskala/repos","events_url":"https://api.github.com/users/michalmuskala/events{/privacy}","received_events_url":"https://api.github.com/users/michalmuskala/received_events","type":"User","site_admin":false},"body":"Only with assocs/embeds or with other things too?","created_at":"2015-09-13T20:24:11Z","updated_at":"2015-09-13T20:24:11Z","html_url":"https://github.com/elixir-lang/ecto/pull/952#discussion_r39351660","pull_request_url":"https://api.github.com/repos/elixir-lang/ecto/pulls/952","_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/ecto/pulls/comments/39351660"},"html":{"href":"https://github.com/elixir-lang/ecto/pull/952#discussion_r39351660"},"pull_request":{"href":"https://api.github.com/repos/elixir-lang/ecto/pulls/952"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-lang/ecto/pulls/952","id":44877667,"html_url":"https://github.com/elixir-lang/ecto/pull/952","diff_url":"https://github.com/elixir-lang/ecto/pull/952.diff","patch_url":"https://github.com/elixir-lang/ecto/pull/952.patch","issue_url":"https://api.github.com/repos/elixir-lang/ecto/issues/952","number":952,"state":"open","locked":false,"title":"[WIP] Introduce on_replace :raise and :mark_as_invalid","user":{"login":"michalmuskala","id":477062,"avatar_url":"https://avatars.githubusercontent.com/u/477062?v=3","gravatar_id":"","url":"https://api.github.com/users/michalmuskala","html_url":"https://github.com/michalmuskala","followers_url":"https://api.github.com/users/michalmuskala/followers","following_url":"https://api.github.com/users/michalmuskala/following{/other_user}","gists_url":"https://api.github.com/users/michalmuskala/gists{/gist_id}","starred_url":"https://api.github.com/users/michalmuskala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalmuskala/subscriptions","organizations_url":"https://api.github.com/users/michalmuskala/orgs","repos_url":"https://api.github.com/users/michalmuskala/repos","events_url":"https://api.github.com/users/michalmuskala/events{/privacy}","received_events_url":"https://api.github.com/users/michalmuskala/received_events","type":"User","site_admin":false},"body":"Closes #949 ","created_at":"2015-09-13T18:19:22Z","updated_at":"2015-09-13T20:24:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a98e335b061e4591740d45a3619880a481e575d7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elixir-lang/ecto/pulls/952/commits","review_comments_url":"https://api.github.com/repos/elixir-lang/ecto/pulls/952/comments","review_comment_url":"https://api.github.com/repos/elixir-lang/ecto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-lang/ecto/issues/952/comments","statuses_url":"https://api.github.com/repos/elixir-lang/ecto/statuses/744790493167f5847ad0b3553273ce4872723672","head":{"label":"michalmuskala:on_replace","ref":"on_replace","sha":"744790493167f5847ad0b3553273ce4872723672","user":{"login":"michalmuskala","id":477062,"avatar_url":"https://avatars.githubusercontent.com/u/477062?v=3","gravatar_id":"","url":"https://api.github.com/users/michalmuskala","html_url":"https://github.com/michalmuskala","followers_url":"https://api.github.com/users/michalmuskala/followers","following_url":"https://api.github.com/users/michalmuskala/following{/other_user}","gists_url":"https://api.github.com/users/michalmuskala/gists{/gist_id}","starred_url":"https://api.github.com/users/michalmuskala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalmuskala/subscriptions","organizations_url":"https://api.github.com/users/michalmuskala/orgs","repos_url":"https://api.github.com/users/michalmuskala/repos","events_url":"https://api.github.com/users/michalmuskala/events{/privacy}","received_events_url":"https://api.github.com/users/michalmuskala/received_events","type":"User","site_admin":false},"repo":{"id":36659898,"name":"ecto","full_name":"michalmuskala/ecto","owner":{"login":"michalmuskala","id":477062,"avatar_url":"https://avatars.githubusercontent.com/u/477062?v=3","gravatar_id":"","url":"https://api.github.com/users/michalmuskala","html_url":"https://github.com/michalmuskala","followers_url":"https://api.github.com/users/michalmuskala/followers","following_url":"https://api.github.com/users/michalmuskala/following{/other_user}","gists_url":"https://api.github.com/users/michalmuskala/gists{/gist_id}","starred_url":"https://api.github.com/users/michalmuskala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalmuskala/subscriptions","organizations_url":"https://api.github.com/users/michalmuskala/orgs","repos_url":"https://api.github.com/users/michalmuskala/repos","events_url":"https://api.github.com/users/michalmuskala/events{/privacy}","received_events_url":"https://api.github.com/users/michalmuskala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michalmuskala/ecto","description":"A database wrapper and language integrated query for Elixir","fork":true,"url":"https://api.github.com/repos/michalmuskala/ecto","forks_url":"https://api.github.com/repos/michalmuskala/ecto/forks","keys_url":"https://api.github.com/repos/michalmuskala/ecto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michalmuskala/ecto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michalmuskala/ecto/teams","hooks_url":"https://api.github.com/repos/michalmuskala/ecto/hooks","issue_events_url":"https://api.github.com/repos/michalmuskala/ecto/issues/events{/number}","events_url":"https://api.github.com/repos/michalmuskala/ecto/events","assignees_url":"https://api.github.com/repos/michalmuskala/ecto/assignees{/user}","branches_url":"https://api.github.com/repos/michalmuskala/ecto/branches{/branch}","tags_url":"https://api.github.com/repos/michalmuskala/ecto/tags","blobs_url":"https://api.github.com/repos/michalmuskala/ecto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michalmuskala/ecto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michalmuskala/ecto/git/refs{/sha}","trees_url":"https://api.github.com/repos/michalmuskala/ecto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michalmuskala/ecto/statuses/{sha}","languages_url":"https://api.github.com/repos/michalmuskala/ecto/languages","stargazers_url":"https://api.github.com/repos/michalmuskala/ecto/stargazers","contributors_url":"https://api.github.com/repos/michalmuskala/ecto/contributors","subscribers_url":"https://api.github.com/repos/michalmuskala/ecto/subscribers","subscription_url":"https://api.github.com/repos/michalmuskala/ecto/subscription","commits_url":"https://api.github.com/repos/michalmuskala/ecto/commits{/sha}","git_commits_url":"https://api.github.com/repos/michalmuskala/ecto/git/commits{/sha}","comments_url":"https://api.github.com/repos/michalmuskala/ecto/comments{/number}","issue_comment_url":"https://api.github.com/repos/michalmuskala/ecto/issues/comments{/number}","contents_url":"https://api.github.com/repos/michalmuskala/ecto/contents/{+path}","compare_url":"https://api.github.com/repos/michalmuskala/ecto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michalmuskala/ecto/merges","archive_url":"https://api.github.com/repos/michalmuskala/ecto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michalmuskala/ecto/downloads","issues_url":"https://api.github.com/repos/michalmuskala/ecto/issues{/number}","pulls_url":"https://api.github.com/repos/michalmuskala/ecto/pulls{/number}","milestones_url":"https://api.github.com/repos/michalmuskala/ecto/milestones{/number}","notifications_url":"https://api.github.com/repos/michalmuskala/ecto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michalmuskala/ecto/labels{/name}","releases_url":"https://api.github.com/repos/michalmuskala/ecto/releases{/id}","created_at":"2015-06-01T12:41:23Z","updated_at":"2015-06-01T12:41:24Z","pushed_at":"2015-09-13T18:18:48Z","git_url":"git://github.com/michalmuskala/ecto.git","ssh_url":"git@github.com:michalmuskala/ecto.git","clone_url":"https://github.com/michalmuskala/ecto.git","svn_url":"https://github.com/michalmuskala/ecto","homepage":"","size":5275,"stargazers_count":0,"watchers_count":0,"language":"Elixir","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":"elixir-lang:master","ref":"master","sha":"ef04657980f045f6318b8f2a377fac913905f518","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":10649374,"name":"ecto","full_name":"elixir-lang/ecto","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/ecto","description":"A database wrapper and language integrated query for Elixir","fork":false,"url":"https://api.github.com/repos/elixir-lang/ecto","forks_url":"https://api.github.com/repos/elixir-lang/ecto/forks","keys_url":"https://api.github.com/repos/elixir-lang/ecto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/ecto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/ecto/teams","hooks_url":"https://api.github.com/repos/elixir-lang/ecto/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/ecto/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/ecto/events","assignees_url":"https://api.github.com/repos/elixir-lang/ecto/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/ecto/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/ecto/tags","blobs_url":"https://api.github.com/repos/elixir-lang/ecto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/ecto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/ecto/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/ecto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/ecto/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/ecto/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/ecto/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/ecto/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/ecto/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/ecto/subscription","commits_url":"https://api.github.com/repos/elixir-lang/ecto/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/ecto/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/ecto/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/ecto/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/ecto/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/ecto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/ecto/merges","archive_url":"https://api.github.com/repos/elixir-lang/ecto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/ecto/downloads","issues_url":"https://api.github.com/repos/elixir-lang/ecto/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/ecto/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/ecto/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/ecto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/ecto/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/ecto/releases{/id}","created_at":"2013-06-12T18:42:06Z","updated_at":"2015-09-13T19:37:36Z","pushed_at":"2015-09-13T18:31:17Z","git_url":"git://github.com/elixir-lang/ecto.git","ssh_url":"git@github.com:elixir-lang/ecto.git","clone_url":"https://github.com/elixir-lang/ecto.git","svn_url":"https://github.com/elixir-lang/ecto","homepage":"","size":11262,"stargazers_count":1050,"watchers_count":1050,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":226,"mirror_url":null,"open_issues_count":18,"forks":226,"open_issues":18,"watchers":1050,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/ecto/pulls/952"},"html":{"href":"https://github.com/elixir-lang/ecto/pull/952"},"issue":{"href":"https://api.github.com/repos/elixir-lang/ecto/issues/952"},"comments":{"href":"https://api.github.com/repos/elixir-lang/ecto/issues/952/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-lang/ecto/pulls/952/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-lang/ecto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-lang/ecto/pulls/952/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-lang/ecto/statuses/744790493167f5847ad0b3553273ce4872723672"}}}}