Wrap comment params for flat JSON payloads (#2679)
* Wrap comment params for flat JSON payloads
The SDK sends flat JSON ({"body": "..."}) but Rails wrap_parameters
auto-detection misses :body since it's a virtual ActionText attribute,
not in Comment.attribute_names. Explicitly declare wrap_parameters so
params.expect(comment: [...]) works with both wrapped and flat payloads.
* Test comment create and update with flat JSON params
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
class Cards::CommentsController < ApplicationController
|
||||
wrap_parameters :comment, include: %i[ body created_at ]
|
||||
include CardScoped
|
||||
|
||||
before_action :set_comment, only: %i[ show edit update destroy ]
|
||||
|
||||
Reference in New Issue
Block a user