Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError: undefined method `rindex' for {}:Hash #46

Open
chrisconley opened this issue Apr 1, 2012 · 2 comments
Open

NoMethodError: undefined method `rindex' for {}:Hash #46

chrisconley opened this issue Apr 1, 2012 · 2 comments
Assignees

Comments

@chrisconley
Copy link

Hi John,

Somewhere along the way, it looks like __tags__ is getting set to an empty hash in our workitems. We're storing workitems in Mongo outside of Ruote, so it may be that Mongoid/Mongo is converting the __tags__ value to a hash, but just wanted to ping you to see if you had any ideas where to look within Ruote that could be causing this, so I could try to get a test case prepared.

The error message and trace are below.

Thanks,
Chris

    message: #<NoMethodError: undefined method `rindex' for {}:Hash>
    trace:
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/workitem.rb:434:in `remove_tag'
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/exp/flow_expression.rb:887:in `leave_tag'
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/exp/flow_expression.rb:369:in `reply_to_parent'
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/exp/fe_cursor.rb:268:in `move_on'
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/exp/commanded.rb:53:in `reply'
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/exp/flow_expression.rb:508:in `do_reply'
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/exp/flow_expression.rb:301:in `do_action'
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/worker.rb:330:in `process'
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/worker.rb:212:in `step'
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/worker.rb:93:in `run'
      /app/vendor/bundle/ruby/1.9.1/bundler/gems/ruote-d69981252e3d/lib/ruote/worker.rb:104:in `block in run_in_thread'
@jmettraux
Copy link
Owner

Hello Chris,

I've looked at the code for add_tag and remove_tag and yes, it's expecting an Array instance. We could tell those two methods to ignore tags if it's not containing an Array, but I'm not sure if silently working around non Array values is the right solution.

Keeping it open for now.

BTW, I have not forgotten #42 I want to get back working on it very soon

@chrisconley
Copy link
Author

I looked into this a bit more and it looks like __tags__ is getting set to an empty hash when the workflow resets to the beginning. I don't have a simplified test case yet but I'll try to get that put together in the next couple of days.

Thanks for the note on the other issue - I do have a workaround for the time being using :break_if, so no rush.

Thanks,
Chris

@ghost ghost assigned jmettraux Apr 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants