README.md in unread-mongoid-0.0.5 vs README.md in unread-mongoid-0.1.0
- old
+ new
@@ -2,43 +2,20 @@
======
Ruby gem to manage read/unread status of Mongoid objects.
## Credit
-First and foremost this is a fork of [Unread](https://github.com/ledermann/unread) by [Georg Ledermann](http://www.georg-ledermann.de). If you don't have to use Mongo for this I highly reccomend you use his gem, this is a task much better suited to a relational db.
+First and foremost this is a fork of [Unread](https://github.com/ledermann/unread) by [Georg Ledermann](http://www.georg-ledermann.de). If you are using a relational DB, make sure to check it out.
## Features
* Manages unread records for anything you want users to read (like messages, documents, comments etc.)
* Supports _mark as read_ to mark a **single** record as read
-* Supports _mark all as read_ to mark **all** records as read in a single step
+* Supports _mark all as read_ to mark **all** records (loops through creating a readmark for each)
* Gives you a scope to get the unread or read records for a given user
* Needs only one additional collection
-
-## Requirements
-
-* Ruby 1.8.7 or 1.9.3 or 2.0.0
-* Rails 3 (including 3.0, 3.1, 3.2) and Rails 4.
-* Needs a timestamp field in your models (like created_at or updated_at) with a database index on it
-
-
-## Installation
-
-Step 1: Add this to your Gemfile:
-
-```ruby
-gem 'unread-mongoid'
-```
-
-and run
-
-```shell
-bundle
-```
-
-
## Usage
```ruby
class User
include Mongoid::Document
@@ -50,11 +27,11 @@
class Message
include Mongoid::Document
include Mongoid::Timestamps
include UnreadMongoid
- acts_as_readable :on => :created_at
+ acts_as_readable
end
message1 = Message.create!
message2 = Message.create!
@@ -67,10 +44,6 @@
# => [ message2 ]
Message.mark_as_read! :all, :for => current_user
Message.unread_by(current_user).entries
# => [ ]
-
-# Optional: Cleaning up unneeded markers.
-# Do this in a cron job once a day.
-Message.cleanup_read_marks!
```