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

minor typos in application using workflow - better error messages? #2

Closed
JezC opened this issue Feb 2, 2010 · 1 comment
Closed

Comments

@JezC
Copy link

JezC commented Feb 2, 2010

Hi - beginner error here... but an uninformative diagnostic error message. I accidentally typed "transition_to" instead of "transitions_to". Which provokes a message about an undefined method "to_sym" for nil.Class. Not very obvious that there's a missing required parameter...
Can I suggest a one liner enhancement to the initialize function?

def initialize(name, transitions_to, meta = {}, &action)
  raise "missing 'transitions_to' from workflow for '#{name}'" if transitions_to == nil 
  @name, @transitions_to, @meta, @action = name, transitions_to.to_sym, meta, action
end
@geekq
Copy link
Owner

geekq commented Feb 4, 2010

Added a better message. Additionally added :transition_to alias to avoid the problem in the first place.

This issue was closed.
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