trailblazer-rails
trailblazer-rails copied to clipboard
2.2.0 release breaks with cell-rails when model isn't given
In cell-rails the model is optional. Cells can be invoked like this in ActionView templates:
<%= cell(MyCell) %>
You can see this here:
https://github.com/trailblazer/cells-rails/blob/master/lib/cell/rails.rb#L28
But now the model
argument is not optional in the cell
method in trailblazer-rails. I think it was introduced in this commit:
https://github.com/trailblazer/trailblazer-rails/commit/95cc4f2c915ee093cbbbae9ab95c8578455431d9#diff-efbc05b6b0e67ea0f9e3f2fc2d6d38e4bdb32095d5a48698bb6de09482fc621bR20
Now invoking a cell without passing a model gives this error:
response: wrong number of arguments (given 1, expected 2..3)
Do we even need to handle cells in this gem ? we already have cells-rails.
We could actually move this method and friends over to cells-rails
, but the model should be optional, that's true!
@apotonick any news on this?
Is seems this issue was fixed because in master model is optional: https://github.com/trailblazer/trailblazer-rails/blob/master/lib/trailblazer/rails/cell.rb#L18
Oh right, I fixed it :laughing: