Open thejbix opened 2 years ago
Is it possible to have a model extend PublicActivity::Activity
class Activity < PublicActivity::Activity
after_commit :base_after_commit
def base_after_commit
puts "After Commit for PublicActivity"
end
end
And have PublicActivity use this new model by default instead of PublicActivity::Activity ?
@thejbix This has been address in the following PR: https://github.com/public-activity/public_activity/pull/154. However, that PR needs work, i.e. rebasing. I haven’t had the time myself yet but feel free to take a stab at it.
I'd like to access an after_commit callback to run custom code when an activity has been created. How can this be done?
The purpose for this is I'd like to send updates or alerts when an activity is created/updated/ or destroyed.
Using Rails 7