Skip to content

Document Command::call method fallback behavior when block is given #56

@szpasztor

Description

@szpasztor

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 params vs @params in the command object won't cause any errors because params is 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions