infinitered / ProMotion-form

Deprecated -- use ProMotion-XLForm
19 stars 11 forks source link

Add a safety check when action methods don't accept an argument #44

Closed andrewhavens closed 9 years ago

andrewhavens commented 9 years ago

I'm reporting this as an idea to save people (myself) from making this mistake in the future. When you define a cell with an :action, it's important to define the action method to accept the cell as an argument. Otherwise the app will crash without any explanation.

So I was thinking, maybe we could add a safety check to make sure the method is defined and accepts the correct number of arguments before passing the data to FXForms.

jamonholmgren commented 9 years ago

Should be easy enough with #method.arity. Watch for negative arity, though, if it's an optional arg.

jamonholmgren commented 9 years ago

ProMotion-form has been officially deprecated. Thanks everyone!

http://jamonholmgren.com/deprecating-promotion-form/