Replies: 1 comment 4 replies
-
Your approach should work but we didn't document that method as an exposed API, you can keep it but it can change What I recommend is to use the exposed methods from the documentation https://docs.avohq.io/3.0/controllers.html For example for a callback on success creation: class Avo::VideosController < Avo::ResourcesController
def create_success_action
@record.created_from_avo
super
end
end This applies when you want certain callbacks to trigger only when a record is created through Avo. For a more universal solution, I recommend using Active Record callbacks. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was wondering if there are any recommended patterns for calling custom business logic such as service objects when creating or updating resources. In a couple instances I've overridden
#save_record_action
to add necessary business logic on save but I was wondering if there was a better approach?Example:
Beta Was this translation helpful? Give feedback.
All reactions