discourse/spec
Loïc Guitaut 584424594e DEV: Replace params by the contract object in services
This patch replaces the parameters provided to a service through
`params` by the contract object.

That way, it allows better consistency when accessing input params. For
example, if you have a service without a contract, to access a
parameter, you need to use `params[:my_parameter]`. But with a contract,
you do this through `contract.my_parameter`. Now, with this patch,
you’ll be able to access it through `params.my_parameter` or
`params[:my_parameter]`.

Some methods have been added to the contract object to better mimic a
Hash. That way, when accessing/using `params`, you don’t have to think
too much about it:
- `params.my_key` is also accessible through `params[:my_key]`.
- `params.my_key = value` can also be done through `params[:my_key] =
  value`.
- `#slice` and `#merge` are available.
- `#to_hash` has been implemented, so the contract object will be
  automatically cast as a hash by Ruby depending on the context. For
  example, with an AR model, you can do this: `user.update(**params)`.
2024-10-25 14:48:34 +02:00
..
fabricators DEV: Migrate user passwords data to UserPassword table (#28746) 2024-10-10 09:23:06 +08:00
fixtures DEV: Remove logical OR assignment of constants (#29201) 2024-10-16 10:09:07 +08:00
generator DEV: Silence the output of migration specs (#26365) 2024-03-26 11:32:44 +01:00
helpers DEV: Call Discourse.redis.flushdb after the end of each test (#29117) 2024-10-09 07:19:31 +08:00
import_export
initializers
integration DEV: Attempt to fix a flaky spec (#29155) 2024-10-10 17:19:53 +08:00
integrity DEV: Add spec to ensure app works with multiple tagged loggers 2024-08-13 18:10:03 +02:00
jobs DEV: Fix linting in notify_category_change_spec (#29175) 2024-10-11 19:55:33 +02:00
lib DEV: Replace params by the contract object in services 2024-10-25 14:48:34 +02:00
mailers UX: Use a dropdown for SSL mode for group SMTP (#27932) 2024-07-18 10:33:14 +10:00
migrations DEV: Remove invalid content_security_policy_script_src site setting values from DB (#27588) 2024-06-27 22:17:56 +08:00
models DEV: Delete plugin specific webhook event types (#29374) 2024-10-24 11:02:58 -05:00
multisite FEATURE: allow admins to enable announced experimental features (#29244) 2024-10-22 10:56:58 +11:00
requests FIX: Skip CSRF check for POST /categories/search (#29392) 2024-10-24 17:06:21 +03:00
script/import_scripts DEV: Catch missing translations during test runs (#26258) 2024-05-24 22:15:53 +08:00
serializers DEV: Set topic list filter name in serializer for children (#29291) 2024-10-18 17:24:47 -03:00
services DEV: Replace params by the contract object in services 2024-10-25 14:48:34 +02:00
support DEV: Improve isolation and concurrency for minio-based upload specs (#29216) 2024-10-16 10:40:58 +01:00
system DEV: Attempt to fix flaky signup spec (#29396) 2024-10-24 13:05:41 -03:00
tasks DEV: update rake task to disable 2FA for a user (#29052) 2024-10-16 09:11:29 +11:00
views FEATURE: Simplify crawler content for non-canonical post URLs (#26324) 2024-03-26 15:18:46 +00:00
rails_helper.rb DEV: Improve isolation and concurrency for minio-based upload specs (#29216) 2024-10-16 10:40:58 +01:00
regenerate_swagger_docs
swagger_helper.rb