{"action":"created","issue":{"url":"https://api.github.com/repos/apotonick/reform/issues/315","repository_url":"https://api.github.com/repos/apotonick/reform","labels_url":"https://api.github.com/repos/apotonick/reform/issues/315/labels{/name}","comments_url":"https://api.github.com/repos/apotonick/reform/issues/315/comments","events_url":"https://api.github.com/repos/apotonick/reform/issues/315/events","html_url":"https://github.com/apotonick/reform/issues/315","id":116921978,"number":315,"title":"How to skip validation of nested form?","user":{"login":"jumski","id":9126,"avatar_url":"https://avatars.githubusercontent.com/u/9126?v=3","gravatar_id":"","url":"https://api.github.com/users/jumski","html_url":"https://github.com/jumski","followers_url":"https://api.github.com/users/jumski/followers","following_url":"https://api.github.com/users/jumski/following{/other_user}","gists_url":"https://api.github.com/users/jumski/gists{/gist_id}","starred_url":"https://api.github.com/users/jumski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jumski/subscriptions","organizations_url":"https://api.github.com/users/jumski/orgs","repos_url":"https://api.github.com/users/jumski/repos","events_url":"https://api.github.com/users/jumski/events{/privacy}","received_events_url":"https://api.github.com/users/jumski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-14T12:25:44Z","updated_at":"2016-02-29T18:15:50Z","closed_at":null,"body":"I have a simple form, like this:\r\n\r\n```ruby\r\nclass CopyForm < Reform::Form\r\n  property :condition\r\n  property :purchase_price\r\n  property :edition_id\r\n\r\n  property :edition, form: EditionForm, skip_if: ->(*) { edition_id.present? }\r\nend\r\n```\r\n\r\nI want to validate `EditionForm` only if `:edition_id` is blank. How can i accomplish this? Tried with `skip_if` as above but it does not yield expected results.\r\n\r\nThanks in advance\r\nWojtek"},"comment":{"url":"https://api.github.com/repos/apotonick/reform/issues/comments/190317264","html_url":"https://github.com/apotonick/reform/issues/315#issuecomment-190317264","issue_url":"https://api.github.com/repos/apotonick/reform/issues/315","id":190317264,"user":{"login":"apotonick","id":10406,"avatar_url":"https://avatars.githubusercontent.com/u/10406?v=3","gravatar_id":"","url":"https://api.github.com/users/apotonick","html_url":"https://github.com/apotonick","followers_url":"https://api.github.com/users/apotonick/followers","following_url":"https://api.github.com/users/apotonick/following{/other_user}","gists_url":"https://api.github.com/users/apotonick/gists{/gist_id}","starred_url":"https://api.github.com/users/apotonick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apotonick/subscriptions","organizations_url":"https://api.github.com/users/apotonick/orgs","repos_url":"https://api.github.com/users/apotonick/repos","events_url":"https://api.github.com/users/apotonick/events{/privacy}","received_events_url":"https://api.github.com/users/apotonick/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T18:15:50Z","updated_at":"2016-02-29T18:15:50Z","body":"Everything is a \"simple problem\" when you're only talking about \"your own\" problems - once you start solving problems for a huge user base, it gets a bit more complicated and you have to pick your API wisely. This in turn is, very often, in our generous OSS community, interpreted as \"too complicated\".\r\n\r\nTBH, I still don't understand what your request involves. You want to populate the nested form with the input (from `validate`) and then only run validations for nested forms if your `:if` is evaluated to true? Is that what you mean by \"to decide if validation should be run or not\"?"}}