I have an ActiveModel (not ActiveRecord) in my Rails app. The ActiveModel is an interface to a 3rd party service. I create a user in the 3rd party service via my ActiveModel. I fetch the user in the 3rd party service. I update the user in the 3rd party service. Etc Etc.

Now i want to keep logs of changes on the user object. But the problem is, the user object itself is in a 3rd party. I don't have the DB record for that. My ActiveModel is used just as an interface to a DB record in the 3rd party. But PaperTrail works by adding behaviors on ActiveRecords (which are essentially DB-backed ActiveModels).

How do i implement a PaperTrail-like behavior on my ActiveModel to keep track of the changes i am doing on the remote DB record, while the actual DB record for the active model is not sitting in my control?

0 Answers