Custom on option on update action

What is the idiomatic way to pass a custom option to an action. Id like to achieve the following:
update_contact_cool_action(contact, attrs, push_sync: false)
update_contact_cool_action(contact, attrs, push_sync: false)
eventually the option would have a default value. - I saw I can define an argument, but then it needs to be merged into the attributes - I can use the context but no default - I can create a new action - else? Also, if I go about creating the two actions they would share several custom changes, how i'd go at abstracting that "pipelaine" and re use it?
2 Replies
barnabasj
barnabasj3w ago
My first instinct would have been context, you can have the default in your change module. But maybe if you could go into a bit more detail on what you are trying to do with the option, we might find a better way. About the pipeline, usually, you just have both action definitions with the same changes configured. Can you describe what you are looking to achieve?
Marco Dell'Olio
Marco Dell'OlioOP3w ago
yeah, I need to update a resource and sometime I need to sync the changes to a third party system

Did you find this page helpful?