trailblazer-rails icon indicating copy to clipboard operation
trailblazer-rails copied to clipboard

2.2.0 release breaks with cell-rails when model isn't given

Open samstickland opened this issue 3 years ago • 2 comments

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)

samstickland avatar Dec 17 '21 22:12 samstickland

Do we even need to handle cells in this gem ? we already have cells-rails.

seuros avatar Dec 27 '21 23:12 seuros

We could actually move this method and friends over to cells-rails, but the model should be optional, that's true!

apotonick avatar Dec 28 '21 07:12 apotonick

@apotonick any news on this?

AlfonsoUceda avatar Dec 01 '22 14:12 AlfonsoUceda

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

AlfonsoUceda avatar Dec 01 '22 14:12 AlfonsoUceda

Oh right, I fixed it :laughing:

apotonick avatar Dec 01 '22 16:12 apotonick