{"action":"created","issue":{"url":"https://api.github.com/repos/geekq/workflow/issues/170","labels_url":"https://api.github.com/repos/geekq/workflow/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/geekq/workflow/issues/170/comments","events_url":"https://api.github.com/repos/geekq/workflow/issues/170/events","html_url":"https://github.com/geekq/workflow/issues/170","id":123718825,"number":170,"title":"x.spec throws error. Is spec keyword in workflow? - no implicit conversion of Workflow::Specification into String","user":{"login":"emclab","id":946013,"avatar_url":"https://avatars.githubusercontent.com/u/946013?v=3","gravatar_id":"","url":"https://api.github.com/users/emclab","html_url":"https://github.com/emclab","followers_url":"https://api.github.com/users/emclab/followers","following_url":"https://api.github.com/users/emclab/following{/other_user}","gists_url":"https://api.github.com/users/emclab/gists{/gist_id}","starred_url":"https://api.github.com/users/emclab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emclab/subscriptions","organizations_url":"https://api.github.com/users/emclab/orgs","repos_url":"https://api.github.com/users/emclab/repos","events_url":"https://api.github.com/users/emclab/events{/privacy}","received_events_url":"https://api.github.com/users/emclab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-23T20:30:37Z","updated_at":"2015-12-23T23:04:13Z","closed_at":null,"body":"There are 2 models order and order_items. order has_many order_items. There is a workflow defined in model order. In order_item table there is a spec attribute which stores part specification (in text) . \r\n\r\n  class Order < ActiveRecord::Base\r\n      include Workflow\r\n      has_many :order_items\r\n  end\r\n\r\n  class Order_Item < ActiveRecord::Base\r\n      belong_to :order\r\n  end\r\n\r\nGiven an order in @order, we did the following:\r\n\r\n   @order.order_items.map {|x| [x.name + x.spec, x.item_num]}\r\n\r\nwhich should return an array. However the x.spec causes the error below:\r\n\r\n   no implicit conversion of Workflow::Specification into String\r\n\r\nIt seems that x.spec triggers workflow in model order and tried to return Workflow::Specification. In debug we examine the value in order_item and there is a valid text value for spec attribute. \r\n\r\nWhy x.spec (x is an order_item) tries to return workflow specification in order? Is it a bug in workflow engine?"},"comment":{"url":"https://api.github.com/repos/geekq/workflow/issues/comments/167006059","html_url":"https://github.com/geekq/workflow/issues/170#issuecomment-167006059","issue_url":"https://api.github.com/repos/geekq/workflow/issues/170","id":167006059,"user":{"login":"emclab","id":946013,"avatar_url":"https://avatars.githubusercontent.com/u/946013?v=3","gravatar_id":"","url":"https://api.github.com/users/emclab","html_url":"https://github.com/emclab","followers_url":"https://api.github.com/users/emclab/followers","following_url":"https://api.github.com/users/emclab/following{/other_user}","gists_url":"https://api.github.com/users/emclab/gists{/gist_id}","starred_url":"https://api.github.com/users/emclab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emclab/subscriptions","organizations_url":"https://api.github.com/users/emclab/orgs","repos_url":"https://api.github.com/users/emclab/repos","events_url":"https://api.github.com/users/emclab/events{/privacy}","received_events_url":"https://api.github.com/users/emclab/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T23:04:13Z","updated_at":"2015-12-23T23:04:13Z","body":"@order.order_items.map {|x| [x.name, x.item_num]} works fine."}}