Update CHANGELOG with missing entries for version 1.0.2#398
Update CHANGELOG with missing entries for version 1.0.2#398faheemmughal wants to merge 1 commit intoruby-grape:masterfrom
Conversation
|
@faheemmughal Thanks for flagging this, really appreciate it. Could you share a bit more detail about the “400+ failing tests” you mentioned? Specifically:
That should help me understand what’s going on 👍 |
Added entries for missing PRs within the version. Especially for a breaking change that is failing 400+ tests for us.
|
Thank you for being so responsive. In our codebase we are using variations of the following, expose :property, if: ->(model) { model.active? }
expose :storage,
if: ->(model) { model.storage_method.present? } do |model|
check_storage(model, :storage_method)
endUpdate to version 1.0.2 is causing test failures for us: ArgumentError:
wrong number of arguments (given 2, expected 1)And forcing us to change the code to, expose :property, if: ->(model, _) { model.active? }
expose :storage,
if: ->(model, _) { model.storage_method.present? } do |model, _|
check_storage(model, :storage_method)
endI haven't looked too closely at it but it's likely that the change in #389 is the cause. |
|
Thanks for the report and especially for the examples. Sorry for the confusion; this is definitely not the experience we want from the gem. I’ll prepare a patch release to restore the previous behavior as soon as possible. |
|
@faheemmughal l The fix is up in #399. Both your original single-argument style and the two-argument workaround will keep working, so no need to roll back any changes you've already made. Will release 1.0.3 soon. |
#399) ## Summary Upgrading to 1.0.2 breaks commonly used single-argument lambda patterns in `expose` blocks and `if:` conditions: ```ruby expose :property, if: ->(model) { model.active? } expose :storage, if: ->(model) { model.storage_method.present? } do |model| check_storage(model, :storage_method) end ``` These raise `ArgumentError: wrong number of arguments (given 2, expected 1)` since v1.0.2. This PR restores support for single-argument lambdas while preserving the symbol-to-proc (`&:method`) validation introduced in #389. Users who already applied the two-argument workaround (`->(model, _) { ... }`) are not affected — both styles work. Reported in #398.
|
v1.0.3 is out with the fix from #399. I've incorporated the Thanks again for flagging the issue so quickly! And let us know if you run into anything else. |
Added entries for missing PRs within the version. Especially for a breaking change that is failing 400+ tests for us.