Skip to content

Instantly share code, notes, and snippets.

@jmcolella
Created April 22, 2022 20:20
Show Gist options
  • Save jmcolella/dd4d36bd16d4fe8a2bc925d86577c588 to your computer and use it in GitHub Desktop.
Save jmcolella/dd4d36bd16d4fe8a2bc925d86577c588 to your computer and use it in GitHub Desktop.
class OldModel < ApplicationRecord
after_commit :sync_to_new_model
# other methods ...
def sync_to_new_model
# Perform synchronization logic ...
SynchronizeNewModel.peform_async
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment