Skip to content
  • Adam Hess's avatar
    fce9d9b3
    prevent helper_method from calling to_hash · fce9d9b3
    Adam Hess authored
    `helper_method` was taking `**kwargs` on all definitions by default.
    ruby will assume that this means you want keyword args and call
    `to_hash` on what you pass if the object responds to `to_hash`. Instead
    we should only take keyword args if the helper method defined intends
    to pass keyword args.
    
    This also fixes a warning when you pass a hash to your helper method,
    
    ```
    warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
    ```
    
    Also, this would be a good candidate for using `...`, but since `send`
    requires the method as the first argument, we can't use it here.
    fce9d9b3
    prevent helper_method from calling to_hash
    Adam Hess authored
    `helper_method` was taking `**kwargs` on all definitions by default.
    ruby will assume that this means you want keyword args and call
    `to_hash` on what you pass if the object responds to `to_hash`. Instead
    we should only take keyword args if the helper method defined intends
    to pass keyword args.
    
    This also fixes a warning when you pass a hash to your helper method,
    
    ```
    warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
    ```
    
    Also, this would be a good candidate for using `...`, but since `send`
    requires the method as the first argument, we can't use it here.
Loading