discourse/plugins/chat/app
Loïc Guitaut 9e9abe0a82 DEV: Unify params access in services
Currently, there are two ways (kind of) for accessing `params` inside a
service:
- when there is no contract or it hasn’t been reached yet, `params` is
  just the hash that was provided to the service. To access a key, you
  have to use the bracket notation `params[:my_key]`.
- when there is a contract and it has been executed successfully,
  `params` now references the contract and the attributes are accessible
  using methods (`params.my_key`).

This patch unifies how `params` exposes its attributes. Now, even if
there is no contract at all in a service, `params` will expose its
attributes through methods, that way things are more consistent.

This patch also makes sure there is always a `params` object available
even when no `params` key is provided to the service (this allows a
contract to fail because its attributes are blank instead of having the
service raising an error because it doesn’t find `params` in its context).
2024-12-13 11:13:18 +01:00
..
controllers/chat UX: Hide admin header for edit/new webhook (#30194) 2024-12-12 10:49:17 +11:00
jobs DEV: restore AutoJoinChannelBatch job as a no-op to clear queue (#29743) 2024-11-13 18:10:03 +01:00
models DEV: adds blocks support to chat messages (#29782) 2024-11-19 07:07:58 +01:00
queries/chat FEATURE: add mention count to threads (#29739) 2024-11-14 14:10:12 +04:00
serializers/chat FIX: serializes interaction for direct messages (#29844) 2024-11-20 11:26:12 +01:00
services/chat DEV: Unify params access in services 2024-12-13 11:13:18 +01:00
validators/chat
views