rectify
rectify copied to clipboard
Document Command::call method fallback behavior when block is given
When supplying a block to Rectify::Command::call, the calling object instance is saved and its methods become available on the command object as well.
- This should be documented in the readme, as it introduces the possibility of subtle bugs. Eg. if used with rails, accidentally typing
paramsvs@paramsin the command object won't cause any errors becauseparamsis defined on ActionController, but results in unexpected behavior which is also hard to trace. - When the block is omitted, the caller object doesn't get registered and thus its methods don't become available to the command. It might be helpful to document/warn against this as well.
@andypike I can do a PR with added docs if you think this could be useful.