discourse/plugins
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
..
automation FIX: Avoid zipping when adding users to groups (#30263) 2024-12-13 17:24:40 +08:00
chat DEV: Unify params access in services 2024-12-13 11:13:18 +01:00
checklist DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
discourse-details DEV: Use qunit-dom's hasValue wherever possible (#30018) 2024-12-01 20:37:24 +01:00
discourse-lazy-videos Update translations (#28577) 2024-08-29 15:37:52 -04:00
discourse-local-dates DEV: refactor composer-editor/d-editor, a little more (#29973) 2024-12-02 18:24:14 -03:00
discourse-narrative-bot FIX: Link to group didn't work in locales other than English (#30237) 2024-12-12 13:26:51 +01:00
discourse-presence Cleanup mobile topic footer area (#30132) 2024-12-11 14:59:37 +01:00
footnote Update translations (#30062) 2024-12-04 11:59:28 +01:00
poll Update translations (#30202) 2024-12-10 20:16:34 +01:00
spoiler-alert DEV: Use qunit-dom's hasValue wherever possible (#30018) 2024-12-01 20:37:24 +01:00
styleguide Cleanup mobile topic footer area (#30132) 2024-12-11 14:59:37 +01:00