{"action":"created","issue":{"url":"https://api.github.com/repos/state-machines/state_machines-activerecord/issues/33","labels_url":"https://api.github.com/repos/state-machines/state_machines-activerecord/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/state-machines/state_machines-activerecord/issues/33/comments","events_url":"https://api.github.com/repos/state-machines/state_machines-activerecord/issues/33/events","html_url":"https://github.com/state-machines/state_machines-activerecord/issues/33","id":105831615,"number":33,"title":"Doesn't seem to respect conditional validations","user":{"login":"UnderpantsGnome","id":17270,"avatar_url":"https://avatars.githubusercontent.com/u/17270?v=3","gravatar_id":"","url":"https://api.github.com/users/UnderpantsGnome","html_url":"https://github.com/UnderpantsGnome","followers_url":"https://api.github.com/users/UnderpantsGnome/followers","following_url":"https://api.github.com/users/UnderpantsGnome/following{/other_user}","gists_url":"https://api.github.com/users/UnderpantsGnome/gists{/gist_id}","starred_url":"https://api.github.com/users/UnderpantsGnome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UnderpantsGnome/subscriptions","organizations_url":"https://api.github.com/users/UnderpantsGnome/orgs","repos_url":"https://api.github.com/users/UnderpantsGnome/repos","events_url":"https://api.github.com/users/UnderpantsGnome/events{/privacy}","received_events_url":"https://api.github.com/users/UnderpantsGnome/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-10T15:17:31Z","updated_at":"2015-09-10T15:34:17Z","closed_at":null,"body":"I have a model with a conditional validation\r\n\r\n    validates :nda_accepted,\r\n      presence: true,\r\n      unless: :draft?\r\n\r\nbut if I try to transition it fails.\r\n\r\n    >> Rfq.last.valid?\r\n    => true\r\n    >> Rfq.last.delete_draft!\r\n    StateMachines::InvalidTransition: Cannot transition state via :delete_draft from :draft (Reason(s): Nda accepted can't be blank)\r\n    from /Users/mmoen/code/UnderpantsGnome/britehub-app/vendor/bundle/ruby/2.2.0/gems/state_machines-0.4.0/lib/state_machines/event.rb:224:in `block in add_actions'\r\n\r\nGems\r\n\r\n    gem 'state_machines', '~> 0.4.0'\r\n    gem 'state_machines-activerecord', '~> 0.3.0'\r\n    gem 'state_machines-activemodel', '~> 0.3.0'\r\n"},"comment":{"url":"https://api.github.com/repos/state-machines/state_machines-activerecord/issues/comments/139283075","html_url":"https://github.com/state-machines/state_machines-activerecord/issues/33#issuecomment-139283075","issue_url":"https://api.github.com/repos/state-machines/state_machines-activerecord/issues/33","id":139283075,"user":{"login":"seuros","id":2394703,"avatar_url":"https://avatars.githubusercontent.com/u/2394703?v=3","gravatar_id":"","url":"https://api.github.com/users/seuros","html_url":"https://github.com/seuros","followers_url":"https://api.github.com/users/seuros/followers","following_url":"https://api.github.com/users/seuros/following{/other_user}","gists_url":"https://api.github.com/users/seuros/gists{/gist_id}","starred_url":"https://api.github.com/users/seuros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seuros/subscriptions","organizations_url":"https://api.github.com/users/seuros/orgs","repos_url":"https://api.github.com/users/seuros/repos","events_url":"https://api.github.com/users/seuros/events{/privacy}","received_events_url":"https://api.github.com/users/seuros/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T15:34:17Z","updated_at":"2015-09-10T15:34:17Z","body":"If you could provide a sample app with sqlite3 so we can debug it quickly ?"}}