{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-ecto/ecto/issues/1107","repository_url":"https://api.github.com/repos/elixir-ecto/ecto","labels_url":"https://api.github.com/repos/elixir-ecto/ecto/issues/1107/labels{/name}","comments_url":"https://api.github.com/repos/elixir-ecto/ecto/issues/1107/comments","events_url":"https://api.github.com/repos/elixir-ecto/ecto/issues/1107/events","html_url":"https://github.com/elixir-ecto/ecto/issues/1107","id":119330981,"number":1107,"title":"Ecto.Changeset.validate_change/3 should check field","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},"labels":[{"url":"https://api.github.com/repos/elixir-ecto/ecto/labels/Kind:Enhancement","name":"Kind:Enhancement","color":"207de5"},{"url":"https://api.github.com/repos/elixir-ecto/ecto/labels/Level:Advanced","name":"Level:Advanced","color":"f7c6c7"},{"url":"https://api.github.com/repos/elixir-ecto/ecto/labels/Note:Discussion","name":"Note:Discussion","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2015-11-29T02:12:12Z","updated_at":"2016-09-05T13:56:42Z","closed_at":null,"body":"It's an issue I see often repeated - someone adding a validation on a field, but forgetting to add it to required or optional fields in cast.\r\n\r\nI propose that we raise in `validate_change/3` if the field is not in the changes map, and is neither in `required` nor `optional` fields."},"comment":{"url":"https://api.github.com/repos/elixir-ecto/ecto/issues/comments/244752911","html_url":"https://github.com/elixir-ecto/ecto/issues/1107#issuecomment-244752911","issue_url":"https://api.github.com/repos/elixir-ecto/ecto/issues/1107","id":244752911,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2016-09-05T13:56:42Z","updated_at":"2016-09-05T13:56:42Z","body":"> The validation function will never run, thus it's safe to raise - the call is either useless and can be removed, or erroneous and should be corrected.\r\n\r\nI disagree. The current code allows two changeset functions to share a validation path even if they don't share all of validations. Maybe we want to do this change anyway, I am just pointing out there is a scenario where the current code is valid and that's why we should start with at least a warning."}}
{"actor":{"display_login":"josevalim"}}