{"action":"created","issue":{"url":"https://api.github.com/repos/brunocascio/UNLP-ruby-evaderApp/issues/1","labels_url":"https://api.github.com/repos/brunocascio/UNLP-ruby-evaderApp/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/brunocascio/UNLP-ruby-evaderApp/issues/1/comments","events_url":"https://api.github.com/repos/brunocascio/UNLP-ruby-evaderApp/issues/1/events","html_url":"https://github.com/brunocascio/UNLP-ruby-evaderApp/issues/1","id":126749586,"number":1,"title":"Fallan las validaciones cuando se intenta crear un cliente con datos de contacto","user":{"login":"lndl","id":1641725,"avatar_url":"https://avatars.githubusercontent.com/u/1641725?v=3","gravatar_id":"","url":"https://api.github.com/users/lndl","html_url":"https://github.com/lndl","followers_url":"https://api.github.com/users/lndl/followers","following_url":"https://api.github.com/users/lndl/following{/other_user}","gists_url":"https://api.github.com/users/lndl/gists{/gist_id}","starred_url":"https://api.github.com/users/lndl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lndl/subscriptions","organizations_url":"https://api.github.com/users/lndl/orgs","repos_url":"https://api.github.com/users/lndl/repos","events_url":"https://api.github.com/users/lndl/events{/privacy}","received_events_url":"https://api.github.com/users/lndl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-14T21:15:06Z","updated_at":"2016-01-15T12:19:37Z","closed_at":null,"body":"Al intentar crear un cliente con contacto/s se informa que hay campos con errores pero no destaca a ninguno en particular. La prueba por consola arroja lo siguiente:\r\n\r\n```\r\n#<ActiveModel::Errors:0x007faa83adfb08 @base=#<Client id: nil, firstname: \"Sarasa\", lastname: \"Pepepe\", cuilt: \"20-11111111-5\", birthdate: \"1998-01-01\", genre: 0, i\r\ndentification_number: \"11111111\", created_at: nil, updated_at: nil>, @messages={:\"clients_contacts.client\"=>[\"no puede estar en blanco\"]}>\r\n```\r\n\r\nRevisar las validaciones."},"comment":{"url":"https://api.github.com/repos/brunocascio/UNLP-ruby-evaderApp/issues/comments/171946716","html_url":"https://github.com/brunocascio/UNLP-ruby-evaderApp/issues/1#issuecomment-171946716","issue_url":"https://api.github.com/repos/brunocascio/UNLP-ruby-evaderApp/issues/1","id":171946716,"user":{"login":"lndl","id":1641725,"avatar_url":"https://avatars.githubusercontent.com/u/1641725?v=3","gravatar_id":"","url":"https://api.github.com/users/lndl","html_url":"https://github.com/lndl","followers_url":"https://api.github.com/users/lndl/followers","following_url":"https://api.github.com/users/lndl/following{/other_user}","gists_url":"https://api.github.com/users/lndl/gists{/gist_id}","starred_url":"https://api.github.com/users/lndl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lndl/subscriptions","organizations_url":"https://api.github.com/users/lndl/orgs","repos_url":"https://api.github.com/users/lndl/repos","events_url":"https://api.github.com/users/lndl/events{/privacy}","received_events_url":"https://api.github.com/users/lndl/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T12:19:37Z","updated_at":"2016-01-15T12:19:37Z","body":"Hola Bruno, te dejo un requerimiento del POST que intento hacer (en el tag \"entrega\"):\r\n\r\n```\r\nStarted POST \"/clients\" for 127.0.0.1 at 2016-01-15 09:06:25 -0300\r\nProcessing by ClientsController#create as HTML\r\n  Parameters: {\"utf8\"=>\"✓\", \"authenticity_token\"=>\"/ayIDvF2Qa/o0KEW2dIPD/su3f/2ZUXAzuBEU3ZGHvWbC5P6DriZKorrvF7cdbn/PxmLrfNTChWPJVfJg6OR9w==\", \"client\"=>{\"firstname\"=>\"Pepe\", \"lastname\"=>\"Perez\", \"birthdate\"=>\"1986-02-21\", \"genre\"=>\"male\", \"identification_number\"=>\"99999999\", \"cuilt\"=>\"20-99999999-8\", \"clients_contacts_attributes\"=>{\"1452859570768\"=>{\"contact_id\"=>\"1\", \"value\"=>\"3333333333\", \"_destroy\"=>\"false\"}, \"1452859576472\"=>{\"contact_id\"=>\"2\", \"value\"=>\"hola@hola.com\", \"_destroy\"=>\"false\"}}}, \"commit\"=>\"Guardar\"}\r\n   (0.1ms)  begin transaction\r\n  Contact Load (0.1ms)  SELECT  \"contacts\".* FROM \"contacts\" WHERE \"contacts\".\"id\" = ? LIMIT 1  [[\"id\", 1]]\r\n  Contact Load (0.1ms)  SELECT  \"contacts\".* FROM \"contacts\" WHERE \"contacts\".\"id\" = ? LIMIT 1  [[\"id\", 2]]\r\n  Client Exists (0.1ms)  SELECT  1 AS one FROM \"clients\" WHERE \"clients\".\"cuilt\" = '20-99999999-8' LIMIT 1\r\n   (0.1ms)  rollback transaction\r\n  Contact Load (0.6ms)  SELECT \"contacts\".* FROM \"contacts\"\r\n  CACHE (0.0ms)  SELECT \"contacts\".* FROM \"contacts\"\r\n  CACHE (0.0ms)  SELECT \"contacts\".* FROM \"contacts\"\r\n  Rendered clients/_form.html.erb (33.9ms)\r\n  Rendered clients/new.html.erb within layouts/application (34.4ms)\r\nCompleted 200 OK in 179ms (Views: 168.7ms | ActiveRecord: 1.1ms)\r\n```\r\n\r\nSi te guías por los parámetros, vas a ver que intento crear a un cliente (con todos sus datos básicos) + dos datos de contacto (un teléfono y un email). Este POST me tira error, pese a que está todo el form completo; de hecho, la vista señala que hay campos con errores pero no marca ninguno en particular.\r\n\r\nEn los cambios que introdujiste tampoco se corrige el error.\r\n\r\nOjalá se entienda. En última instancia mostrame un contraejemplo y comparamos criterios.\r\n\r\nSaludos! "}}