15 Commits

Author SHA1 Message Date
Jeremy Daer a52b6f1c87 Add explicit wrap_parameters to all controllers (#2680)
* Add explicit wrap_parameters to controllers for flat JSON API support

Virtual attributes (has_rich_text, has_one_attached, delegated setters,
ActiveModel attrs) are not in Model.attribute_names, so wrap_parameters
auto-detection silently drops them from flat JSON requests. Add explicit
include: lists matching each controller's permitted params.

* Convert short-form wrap_parameters to explicit include: lists

Defense-in-depth: these controllers only have real-column params today,
so auto-detection works, but explicit lists prevent future regressions
if virtual attributes are added.

* Add flat JSON param tests for all wrap_parameters controllers

17 new tests covering every controller with wrap_parameters, verifying
that flat (unwrapped) JSON payloads are correctly wrapped and processed.
Focuses on virtual attributes that would be silently dropped without
explicit include: lists.
2026-03-09 21:47:05 -07:00
Rob Zolkos 0435db30ba Add JSON response format to webhooks (#2671)
* Add JSON response format to webhooks

Support JSON responses for all webhook endpoints: index, show, create,
update, destroy, and activation. Adds jbuilder views, updates controllers
to use respond_to, and documents the API in docs/API.md.

* Address PR review feedback

- Use distinct board ID in API docs webhook example
- Use render "webhooks/show" in activations controller for consistency

* Address PR review feedback from flavorjones

- Include webhook.board in cache key to avoid stale board data
- Use _url instead of _path for location header consistency

* Fix webhook create test to match Location header format

Use board_webhook_url instead of board_webhook_path since the controller
returns a full URL in the Location header.

* Fix board ID in Location header example in API docs

Use distinct board ID in the Location URL to match the JSON body example.
2026-03-09 17:33:30 -04:00
Jorge Manrubia 03a345609e Baseline replacing collection with board across code 2025-11-05 13:31:54 +01:00
David Heinemeier Hansson 3ed5c53b31 Use existing CollectionScoped
It enforces access restrictions on collections too
2025-11-03 15:12:38 +01:00
David Heinemeier Hansson 8d28c25a7b Unnecessary 2025-11-03 15:06:41 +01:00
David Heinemeier Hansson ed9259fa1a Ivar not used 2025-11-03 15:04:03 +01:00
David Heinemeier Hansson 60a429e463 Use more naturally-sounding ensures
These match Basecamp and the existing predicate methods
2025-10-29 13:33:34 +01:00
Jorge Manrubia 4527dcbeda Remove unnecessary filtering code
After removing collections from the filtering menu, there was quite a good cleanup here pending
2025-10-03 10:56:34 +02:00
Stanko K.R. 63e64a060d Use HTML5 validation for the URL 2025-09-16 20:08:06 +02:00
Stanko K.R. 02a421675f Scope Webhooks to Collections 2025-09-16 20:07:25 +02:00
Stanko K.R. 25b2daad93 Limit access to webhooks to admins 2025-09-16 20:04:20 +02:00
Stanko K.R. 1b09a39b1a Adhere to the redirect and params sanitization convention 2025-09-16 20:04:20 +02:00
Stanko K.R. 4da69fb69f Move reactivation out of edit 2025-09-16 20:03:57 +02:00
Stanko K.R. 1930067e08 Allow Webhooks to be disabled 2025-09-16 20:03:57 +02:00
Stanko K.R. 9cfd1e43af Enable subscribing to specific actions 2025-09-16 20:03:57 +02:00