Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for updating REST attributes as blocks #1332

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

paulomarg
Copy link
Contributor

Description

Fixes #1287

As pointed out in the issue, there are certain REST hash fields that need to be sent to the server as a whole, regardless of whether their keys are different or not.

To not break other resources, this is being added as an explicit configuration, so that we can enable it if there are other scenarios in which this happens.

How has this been tested?

Unit tests that simulate the actual requests.

Checklist:

  • My commit message follow the pattern described in here
  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added a changelog line.

@paulomarg paulomarg requested a review from a team as a code owner August 1, 2024 13:27
@paulomarg paulomarg force-pushed the rest_block_edit_attributes branch from 3aeca70 to 00b4788 Compare August 1, 2024 13:28
@@ -17,6 +17,7 @@ class Base
@paths = T.let([], T::Array[T::Hash[Symbol, T.any(T::Array[Symbol], String, Symbol)]])
@custom_prefix = T.let(nil, T.nilable(String))
@read_only_attributes = T.let([], T.nilable(T::Array[Symbol]))
@block_update_attributes = T.let([], T::Array[Symbol])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This kinda reads like, this blocks updates to this attribute.
But I don't have any better suggestions. So 🤷

Copy link
Contributor Author

@paulomarg paulomarg Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could name this update_attributes_as_block, or maybe atomic_attributes?

@paulomarg paulomarg force-pushed the rest_block_edit_attributes branch from 00b4788 to 0c432ae Compare August 13, 2024 15:02
@paulomarg paulomarg merged commit c60a49b into main Aug 13, 2024
9 checks passed
@paulomarg paulomarg deleted the rest_block_edit_attributes branch August 13, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot update email marketing consent state if opt-in level doesn't change
2 participants