{"action":"created","issue":{"url":"https://api.github.com/repos/soveran/micromachine/issues/26","labels_url":"https://api.github.com/repos/soveran/micromachine/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/soveran/micromachine/issues/26/comments","events_url":"https://api.github.com/repos/soveran/micromachine/issues/26/events","html_url":"https://github.com/soveran/micromachine/issues/26","id":64596533,"number":26,"title":"Change to callback parameters in 1.2 is backwards-incompatible","user":{"login":"halostatue","id":11361,"avatar_url":"https://avatars.githubusercontent.com/u/11361?v=3","gravatar_id":"","url":"https://api.github.com/users/halostatue","html_url":"https://github.com/halostatue","followers_url":"https://api.github.com/users/halostatue/followers","following_url":"https://api.github.com/users/halostatue/following{/other_user}","gists_url":"https://api.github.com/users/halostatue/gists{/gist_id}","starred_url":"https://api.github.com/users/halostatue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halostatue/subscriptions","organizations_url":"https://api.github.com/users/halostatue/orgs","repos_url":"https://api.github.com/users/halostatue/repos","events_url":"https://api.github.com/users/halostatue/events{/privacy}","received_events_url":"https://api.github.com/users/halostatue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-26T18:05:04Z","updated_at":"2015-03-27T13:32:24Z","closed_at":null,"body":"This is probably a very rare case, but the change in fc9635c is not compatible with the previous version and *could* result in failures.\r\n\r\nThe code below demonstrates:\r\n\r\n```ruby\r\nrequire 'micromachine'\r\n\r\nclass CallbackBug\r\n  def initialize\r\n    @fsm = MicroMachine.new(:new).tap do |fsm|\r\n      fsm.when(:first,  new: :first_stage)\r\n      fsm.when(:second, first_stage: :second_stage)\r\n\r\n      fsm.on(:first_stage, &method(:first_stage))\r\n      fsm.on(:second_stage, &method(:second_stage))\r\n\r\n      fsm.on(:any) do |event|\r\n        puts \"Event #{event} => #{@fsm.state}\"\r\n      end\r\n    end\r\n  end\r\n\r\n  def run\r\n    @fsm.trigger!(:first)\r\n    @fsm.trigger!(:second)\r\n  end\r\n\r\n  private\r\n\r\n  def first_stage(event)\r\n    p event\r\n  end\r\n\r\n  def second_stage\r\n  end\r\nend\r\n\r\nCallbackBug.new.run\r\n```\r\n\r\nThe output of this is:\r\n\r\n```\r\n:first\r\nEvent first => first_stage\r\nArgumentError: wrong number of arguments (1 for 0)\r\nfrom (pry):28:in `second_stage'\r\n```"},"comment":{"url":"https://api.github.com/repos/soveran/micromachine/issues/comments/86940590","html_url":"https://github.com/soveran/micromachine/issues/26#issuecomment-86940590","issue_url":"https://api.github.com/repos/soveran/micromachine/issues/26","id":86940590,"user":{"login":"soveran","id":951,"avatar_url":"https://avatars.githubusercontent.com/u/951?v=3","gravatar_id":"","url":"https://api.github.com/users/soveran","html_url":"https://github.com/soveran","followers_url":"https://api.github.com/users/soveran/followers","following_url":"https://api.github.com/users/soveran/following{/other_user}","gists_url":"https://api.github.com/users/soveran/gists{/gist_id}","starred_url":"https://api.github.com/users/soveran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soveran/subscriptions","organizations_url":"https://api.github.com/users/soveran/orgs","repos_url":"https://api.github.com/users/soveran/repos","events_url":"https://api.github.com/users/soveran/events{/privacy}","received_events_url":"https://api.github.com/users/soveran/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T13:32:24Z","updated_at":"2015-03-27T13:32:24Z","body":"Excellent! Great catch, thanks a lot for reporting the issue. I will check the pull request and I guess I'll continue the conversation there."}}