Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Ruby
  3. mongoid-history

mongoid-history

MITRubyv0.8.5

Multi-user non-linear history tracking, auditing, undo, and redo for Mongoid documents and embedded relations.

Visit WebsiteGitHubGitHub
392 stars130 forks0 contributors

What is mongoid-history?

Mongoid History is a Ruby gem that provides multi-user, non-linear history tracking for Mongoid documents, including embedded relations. It enables auditing, undo, and redo operations by storing all changes in a single collection, making it suitable for applications requiring detailed change logs and collaborative editing features.

Target Audience

Ruby developers using Mongoid with MongoDB who need robust auditing, versioning, or undo/redo functionality in their applications, particularly for collaborative or compliance-sensitive projects.

Value Proposition

Developers choose Mongoid History for its flexible tracking configuration, support for embedded documents, and multi-user undo/redo capabilities, which are not typically available in basic Mongoid setups, making it a comprehensive solution for change tracking and auditing.

Overview

Multi-user non-linear history tracking, auditing, undo, redo for mongoid.

Use Cases

Best For

  • Adding audit trails to Mongoid-based applications for compliance or debugging
  • Implementing undo/redo functionality in collaborative editing features
  • Tracking changes to embedded documents within parent Mongoid models
  • Preventing vandalism in user-editable content with multi-user undo support
  • Creating version histories for documents with non-linear change tracking
  • Building administrative dashboards that display detailed change logs

Not Ideal For

  • Projects using ORMs other than Mongoid (e.g., ActiveRecord) where gems like PaperTrail are better suited
  • Applications requiring linear version history for strict sequential workflows, such as document approval processes
  • High-throughput systems where constant writes to a history collection could degrade database performance
  • Teams seeking plug-and-play auditing with zero configuration, as Mongoid History requires setup and customization

Pros & Cons

Pros

Non-linear History Tracking

Stores all document changes in a single collection, including embedded documents via association paths, enabling comprehensive audit trails without linear constraints.

Multi-user Undo/Redo

Supports undo and redo operations in any order for multiple users, with each action creating a new history track, ideal for collaborative editing and vandalism prevention.

Flexible Configuration

Allows tracking of specific fields, all fields, or embedded relations with customizable options like track_create, track_update, and track_destroy, plus conditional logic with :if and :unless.

Audit Trail Display

Provides methods like tracked_changes and tracked_edits to easily format and display changes in views, simplifying audit trail implementation for administrative dashboards.

Cons

Mongoid-Only Dependency

Exclusively designed for Mongoid with MongoDB, creating vendor lock-in and making it unsuitable for applications using other ORMs or databases.

Performance Overhead

Tracking every change in a separate collection can lead to database bloat and slower write operations, especially in applications with high-frequency updates, as admitted in the README's thread safety notes.

Configuration Complexity

Requires defining tracker classes, setting modifier fields, and configuring tracking options, which can be error-prone and steep for beginners or in complex models with embedded relations.

Frequently Asked Questions

Quick Stats

Stars392
Forks130
Contributors0
Open Issues39
Last commit1 year ago
CreatedSince 2011

Tags

#mongoid#ruby-gem#change-tracking#auditing#mongodb#multi-user#undo-redo#versioning

Built With

J
JRuby
R
Ruby
M
Mongoid

Links & Resources

Website

Included in

Ruby14.1k
Auto-fetched 17 hours ago

Related Projects

PaperTrailPaperTrail

Track changes to your rails models

Stars7,024
Forks911
Last commit2 months ago
ActsAsTaggableOnActsAsTaggableOn

A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.

Stars4,992
Forks1,196
Last commit18 days ago
activerecord-importactiverecord-import

A library for bulk insertion of data into your database using ActiveRecord.

Stars4,152
Forks618
Last commit2 months ago
AncestryAncestry

Organise ActiveRecord model into a tree structure

Stars3,879
Forks472
Last commit29 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub