unread 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -0
- data/MIT-LICENSE +1 -1
- data/README.md +4 -3
- data/changelog.md +11 -0
- data/ci/Gemfile.rails-3.2.x +7 -0
- data/lib/unread/acts_as_readable.rb +1 -1
- data/lib/unread/version.rb +1 -1
- data/test/test_helper.rb +1 -4
- data/unread.gemspec +1 -1
- metadata +9 -11
- data/init.rb +0 -1
- data/uninstall.rb +0 -1
data/.travis.yml
CHANGED
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Ruby gem to manage read/unread status of ActiveRecord objects - and it's fast.
|
|
10
10
|
|
11
11
|
* Manages unread records for anything you want users to read (like messages, documents, comments etc.)
|
12
12
|
* Supports _mark as read_ to mark a **single** record as read
|
13
|
-
* Supports _mark all as
|
13
|
+
* Supports _mark all as read_ to mark **all** records as read in a single step
|
14
14
|
* Gives you a scope to get the unread records for a given user
|
15
15
|
* Needs only one additional database table
|
16
16
|
* Most important: Great performance
|
@@ -19,7 +19,8 @@ Ruby gem to manage read/unread status of ActiveRecord objects - and it's fast.
|
|
19
19
|
## Requirements
|
20
20
|
|
21
21
|
* Ruby 1.8.7 or 1.9.x
|
22
|
-
* Rails 2.3.
|
22
|
+
* Rails >= 2.3.6 (including 3.0, 3.1, 3.2)
|
23
|
+
* Tested with SQLite and MySQL
|
23
24
|
* Needs a timestamp field in your models (e.g. created_at) with a database index on it
|
24
25
|
|
25
26
|
|
@@ -128,4 +129,4 @@ There are two other gems/plugins doing a similar job:
|
|
128
129
|
Unfortunately, both of them have a lack of performance, because they calculate the unread records doing a `find(:all)`, which should be avoided for a large amount of records. This gem is based on a timestamp algorithm and therefore it's very fast.
|
129
130
|
|
130
131
|
|
131
|
-
Copyright (c) 2010,
|
132
|
+
Copyright (c) 2010,2012 [Georg Ledermann](http://www.georg-ledermann.de), released under the MIT license
|
data/changelog.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
0.0.7 - not yet released
|
2
|
+
|
3
|
+
* Cleanup files
|
4
|
+
* acts_as_reader: Using inverse_of (available since Rails 2.3.6)
|
5
|
+
|
6
|
+
0.0.6 - 2011/11/11
|
7
|
+
|
8
|
+
* Fixed #5: Gemspec dependency fix (thanks to @bricker88)
|
9
|
+
* Fixed #6: Removed hard coded dependency on a class named "User" (thanks to @mixandgo)
|
10
|
+
* Some cleanup
|
11
|
+
|
1
12
|
0.0.5 - 2011/09/09
|
2
13
|
|
3
14
|
* Fixed class loading issue in development environment
|
@@ -7,7 +7,7 @@ module Unread
|
|
7
7
|
def acts_as_reader
|
8
8
|
ReadMark.belongs_to :user, :class_name => self.to_s
|
9
9
|
|
10
|
-
has_many :read_marks, :dependent => :delete_all, :foreign_key => 'user_id'
|
10
|
+
has_many :read_marks, :dependent => :delete_all, :foreign_key => 'user_id', :inverse_of => :user
|
11
11
|
|
12
12
|
after_create do |user|
|
13
13
|
(ReadMark.readable_classes || []).each do |klass|
|
data/lib/unread/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -1,11 +1,8 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
|
3
1
|
require 'test/unit'
|
4
2
|
require 'active_support'
|
5
3
|
require 'active_support/test_case'
|
6
4
|
require 'active_record'
|
7
|
-
|
8
|
-
require File.dirname(__FILE__) + '/../init.rb'
|
5
|
+
require 'unread'
|
9
6
|
|
10
7
|
configs = YAML.load_file(File.dirname(__FILE__) + '/database.yml')
|
11
8
|
ActiveRecord::Base.configurations = configs
|
data/unread.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_dependency 'activerecord', '>= 2.3'
|
21
|
+
s.add_dependency 'activerecord', '>= 2.3.6'
|
22
22
|
|
23
23
|
s.add_development_dependency 'rake'
|
24
24
|
s.add_development_dependency 'mocha'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unread
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Georg Ledermann
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
19
|
-
default_executable:
|
18
|
+
date: 2012-02-29 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: activerecord
|
@@ -26,11 +25,12 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
28
|
+
hash: 15
|
30
29
|
segments:
|
31
30
|
- 2
|
32
31
|
- 3
|
33
|
-
|
32
|
+
- 6
|
33
|
+
version: 2.3.6
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
36
|
- !ruby/object:Gem::Dependency
|
@@ -109,7 +109,7 @@ files:
|
|
109
109
|
- ci/Gemfile.rails-2.3.x
|
110
110
|
- ci/Gemfile.rails-3.0.x
|
111
111
|
- ci/Gemfile.rails-3.1.x
|
112
|
-
-
|
112
|
+
- ci/Gemfile.rails-3.2.x
|
113
113
|
- lib/app/models/read_mark.rb
|
114
114
|
- lib/unread.rb
|
115
115
|
- lib/unread/acts_as_readable.rb
|
@@ -118,9 +118,7 @@ files:
|
|
118
118
|
- test/schema.rb
|
119
119
|
- test/test_helper.rb
|
120
120
|
- test/unread_test.rb
|
121
|
-
- uninstall.rb
|
122
121
|
- unread.gemspec
|
123
|
-
has_rdoc: true
|
124
122
|
homepage: ""
|
125
123
|
licenses: []
|
126
124
|
|
@@ -150,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
148
|
requirements: []
|
151
149
|
|
152
150
|
rubyforge_project: unread
|
153
|
-
rubygems_version: 1.
|
151
|
+
rubygems_version: 1.8.17
|
154
152
|
signing_key:
|
155
153
|
specification_version: 3
|
156
154
|
summary: Manages read/unread status of ActiveRecord objects
|
data/init.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'unread'
|
data/uninstall.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Uninstall hook code here
|