You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The originator property is permanently cached on model instances that have paper trails. This breaks the behavior shown in the README. Specifically, this does not work:
The last widget.originator returns 'Alice', not 'Bob'. This is because the originator method on models is defined like this in has_paper_trail.rb:
# Returns who put the object into its current state.deforiginator@originator ||= self.class.paper_trail_version_class.with_item_keys(self.class.base_class.name,id).last.try:whodunnitend
Because of the '||=' in there, originator will never be recomputed for that particular instance. The caching was added in this commit: 43fdce6. I would suggest that that caching either be removed or be invalidated somehow when the originator has actually changed.
Thanks, and thanks for the good work on the gem.
The text was updated successfully, but these errors were encountered:
The originator property is permanently cached on model instances that have paper trails. This breaks the behavior shown in the README. Specifically, this does not work:
The last widget.originator returns 'Alice', not 'Bob'. This is because the originator method on models is defined like this in has_paper_trail.rb:
Because of the '||=' in there, originator will never be recomputed for that particular instance. The caching was added in this commit: 43fdce6. I would suggest that that caching either be removed or be invalidated somehow when the originator has actually changed.
Thanks, and thanks for the good work on the gem.
The text was updated successfully, but these errors were encountered: