discourse/plugins/chat/app
Loïc Guitaut f79dd5c8b5 DEV: Stop injecting a service result object in the caller object
Currently, when calling a service with its block form, a `#result`
method is automatically created on the caller object. Even if it never
clashed so far, this could happen.

This patch removes that method, and instead use a more classical way of
doing things: the result object is now provided as an argument to the
main block. This means if we need to access the result object in an
outcome block, it will be done like this from now on:
```ruby
MyService.call(params) do |result|
  on_success do
    # do something with the result object
    do_something(result)
  end
end
```

In the same vein, this patch introduces the ability to match keys from
the result object in the outcome blocks, like we already do with step
definitions in a service. For example:
```ruby
on_success do |model:, contract:|
  do_something(model, contract)
end
```
Instead of
```ruby
on_success do
  do_something(result.model, result.contract)
end
```
2024-10-22 16:58:54 +02:00
..
controllers/chat DEV: Stop injecting a service result object in the caller object 2024-10-22 16:58:54 +02:00
jobs DEV: Stop injecting a service result object in the caller object 2024-10-22 16:58:54 +02:00
models DEV: Extract leave logic to the `Chat::Channel` model 2024-10-17 14:58:45 +02:00
queries/chat FEATURE: Add ability to watch chat threads (#28639) 2024-09-02 16:45:55 +04:00
serializers/chat DEV: consolidate chat channel notification settings (#29080) 2024-10-08 13:13:01 +04:00
services/chat DEV: Refactor some services from chat 2024-10-21 16:16:25 +02:00
validators/chat FIX: Remove chat default channel setting (#28170) 2024-07-31 14:12:10 -03:00
views PERF: fix performance of chat email notifications 2024-06-10 14:25:06 +02:00