Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Ruby
  3. Unread

Unread

MITRubyv0.14.0

A Ruby on Rails gem to manage read/unread status of ActiveRecord objects with high performance.

GitHubGitHub
741 stars120 forks0 contributors

What is Unread?

Unread is a Ruby gem that manages read and unread statuses for ActiveRecord objects in Ruby on Rails applications. It solves the problem of tracking which records (like messages, documents, or comments) a user has read, providing scopes and methods to query and update read states efficiently. The gem is designed for performance, using a single additional database table and optimized SQL queries.

Target Audience

Ruby on Rails developers building applications that need to track user read states, such as messaging systems, notification feeds, or content platforms where read/unread status is essential.

Value Proposition

Developers choose Unread for its high performance, simplicity, and scalability. It offers a clean API, minimal database overhead, and efficient queries, making it suitable for large datasets without the complexity of alternative solutions.

Overview

Handle unread records and mark them as read with Ruby on Rails

Use Cases

Best For

  • Tracking unread messages or notifications in a Rails app
  • Managing read status for user comments or documents
  • Building activity feeds with read/unread indicators
  • Implementing 'mark all as read' functionality efficiently
  • Handling read states in large-scale Rails applications
  • Adding read tracking to ActiveRecord models with minimal setup

Not Ideal For

  • Projects using non-ActiveRecord ORMs like Sequel or Mongoid
  • Applications requiring real-time read status updates without database queries
  • Simple apps where read tracking can be handled with session or cache storage
  • Systems with strict constraints against adding database tables

Pros & Cons

Pros

High Performance

Uses efficient LEFT JOIN queries and a single read_marks table, optimized for large datasets as shown in the README's SQL example.

Flexible Timestamp Control

Configurable 'on' option allows using fields like created_at or updated_at, preventing unwanted unread status changes on record updates.

Clean Scoped API

Provides intuitive scopes like unread_by and read_by, and methods like mark_as_read!, making integration into Rails models straightforward.

Scalable with Cleanup

Includes mark_as_read! :all for bulk operations and cleanup_read_marks! method to manage table growth, though it requires manual maintenance.

Cons

Manual Maintenance Required

The read_marks table can grow indefinitely without regular cleanup, requiring a cron job as admitted in the README, adding operational overhead.

ActiveRecord Lock-in

Only works with ActiveRecord in Rails, not compatible with other Ruby ORMs or frameworks, limiting its use in mixed-stack applications.

Setup Complexity

Requires generating and running a migration, adding database indexes on timestamp fields, and adhering to specific Ruby and Rails version requirements.

Frequently Asked Questions

Quick Stats

Stars741
Forks120
Contributors0
Open Issues20
Last commit4 months ago
CreatedSince 2010

Tags

#rubygems#database#rails#ruby-gem#activerecord#ruby-on-rails#ruby#rails-plugins#performance

Built With

M
MySQL
S
SQLite
R
Rails
R
Ruby
P
PostgreSQL

Included in

Ruby14.1k
Auto-fetched 18 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