mirror of
https://github.com/discourse/discourse.git
synced 2026-03-03 23:54:20 +08:00
Recently, the `lock` step from our Ruby service framework has been extended to be able to work with keys from the global context when the key isn’t present in the `params`. The implementation is flawed because we usually get a contract object in the `params` key of the context, and currently we call `public_send(key)` on it. This actually raises an error when the key doesn’t exist on the contract. The fix is rather simple, we just use `try` instead, that way if the method doesn’t exist, it returns `nil`, allowing us to get the key from the global context as expected. |
||
|---|---|---|
| .. | ||
| contract_base_spec.rb | ||
| nested_contract_type_spec.rb | ||
| runner_spec.rb | ||
| steps_inspector_spec.rb | ||