2

Recently in one of my projects I was required to add functionality to track all actions(create, update, delete), redo and undo to some models. In the project I am using Mongoid as a ODM. I can add most of these functionalities with mongoid-history. But mongoid-history can not track referenced relations. In my case I have Building model which has_many locations. When I update a location from building form(as nested attribute) then mongoid-history adds appropriate track(document) to history tracker collection but this document is not get related with the building object. Therefore when I call @building.history_tracks I can not get this history track. What would you suggest? Or am I doing something wrong?

hers19
  • 146
  • 2
  • 6

1 Answers1

1

Here is the solution I came up: http://www.elvinefendi.com/2012/06/23/added-new-features-to-the-mongoid-history-gem.html

hers19
  • 146
  • 2
  • 6