public-activity / public_activity

Easy activity tracking for models - similar to Github's Public Activity
MIT License
2.96k stars 334 forks source link

Callbacks not triggered when used in combination with activerecord-import #371

Closed vsolari closed 2 years ago

vsolari commented 2 years ago

Currently I use the 'activerecord-import' gem in some functionalities, when the insertion is done through "import", the "public_activity" does not insert the activity. Is there a way to record the movement of large volumes of data?

ur5us commented 2 years ago

This is not a bug in PublicActivity but a tradeoff of using activerecord-import which is documented here: https://github.com/zdennis/activerecord-import#callbacks. It’s the same with counter caches, also documented a bit further up: https://github.com/zdennis/activerecord-import#counter-cache

As far as I can tell, you have 2 options:

ur5us commented 2 years ago

https://github.com/zdennis/activerecord-import/issues/773