{"action":"closed","issue":{"url":"https://api.github.com/repos/elixir-lang/ecto/issues/1450","repository_url":"https://api.github.com/repos/elixir-lang/ecto","labels_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1450/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1450/comments","events_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1450/events","html_url":"https://github.com/elixir-lang/ecto/issues/1450","id":156288244,"number":1450,"title":"Maybe `validate_confirmation/3` should require the confirmation field","user":{"login":"asonge","id":90809,"avatar_url":"https://avatars.githubusercontent.com/u/90809?v=3","gravatar_id":"","url":"https://api.github.com/users/asonge","html_url":"https://github.com/asonge","followers_url":"https://api.github.com/users/asonge/followers","following_url":"https://api.github.com/users/asonge/following{/other_user}","gists_url":"https://api.github.com/users/asonge/gists{/gist_id}","starred_url":"https://api.github.com/users/asonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asonge/subscriptions","organizations_url":"https://api.github.com/users/asonge/orgs","repos_url":"https://api.github.com/users/asonge/repos","events_url":"https://api.github.com/users/asonge/events{/privacy}","received_events_url":"https://api.github.com/users/asonge/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elixir-lang/ecto/labels/Kind:Enhancement","name":"Kind:Enhancement","color":"207de5"},{"url":"https://api.github.com/repos/elixir-lang/ecto/labels/Level:Starter","name":"Level:Starter","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-05-23T14:02:39Z","updated_at":"2016-06-04T06:33:41Z","closed_at":"2016-06-04T06:33:41Z","body":"The docs say that\r\n\r\n> Note that this does not add a validation error if the confirmation field is nil. Note “email_confirmation” does not need to be added as a virtual field in your schema.\r\n\r\nThe problem is that if I do not add it as a virtual field in my schema, I cannot use `validate_required/3` to make sure the changeset contains the parameter. Virtual fields seem very model-like compared to the schema/representation model we are after in Ecto 2.\r\n\r\nIt seems that we should either provide a way to validate the existence of a parameter *or* `validate_confirmation/3` should have an option to require the confirmation to exist. This seems particularly important as these confirmations are important for security. I can imagine someone using a confirmation to verify the name of a resource that the user has to type in to delete. It might be easy to accidentally forget to include this parameter and enable delete without confirmation."}}
{"actor":{"display_login":"michalmuskala"}}