unread 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ci/Gemfile-rails-3-1 +1 -1
- data/ci/Gemfile-rails-3-2 +1 -1
- data/ci/Gemfile-rails-4-0 +1 -1
- data/ci/Gemfile-rails-4-1 +1 -1
- data/ci/Gemfile-rails-4-2 +1 -1
- data/lib/unread/reader.rb +5 -8
- data/lib/unread/version.rb +1 -1
- data/spec/base_spec.rb +1 -1
- data/spec/model/email.rb +5 -2
- data/spec/read_mark_spec.rb +1 -1
- data/spec/readable_spec.rb +1 -2
- data/spec/spec_helper.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d46186ae6d45d389e56f902320bbce46558ac342
|
4
|
+
data.tar.gz: 704c5a93c4967d69dd13c0ce550cccfe5af25679
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1289afd5a3a6f531ddc2aef5ee8598d58bd0a5b5292deab7a01ed8bd044e64ed79060e53310d682d3f6da88a538e57d2a1b26830e478ddeeb7171da861053c9e
|
7
|
+
data.tar.gz: 055f316a97a375a2c6e266e1cbc34a625562d21c904c0c147b2267caaabe5c8d7d59399b3181e9cc39fc332e411a40f0953e486c8542faed0bf576c947491ecc
|
data/ci/Gemfile-rails-3-1
CHANGED
data/ci/Gemfile-rails-3-2
CHANGED
data/ci/Gemfile-rails-4-0
CHANGED
data/ci/Gemfile-rails-4-1
CHANGED
data/ci/Gemfile-rails-4-2
CHANGED
data/lib/unread/reader.rb
CHANGED
@@ -2,16 +2,13 @@ module Unread
|
|
2
2
|
module Reader
|
3
3
|
module ClassMethods
|
4
4
|
def assert_readable(readable)
|
5
|
-
|
6
|
-
|
7
|
-
unless ReadMark.readable_classes.include?(readable.class)
|
8
|
-
raise ArgumentError, "Class #{readable.class.name} is not registered by acts_as_readable."
|
5
|
+
unless readable.respond_to?(:mark_as_read!)
|
6
|
+
raise ArgumentError, "Class #{readable.class} is not registered by acts_as_readable."
|
9
7
|
end
|
10
|
-
raise ArgumentError, "The given #{readable.class.name} has no id." unless readable.id
|
11
|
-
end
|
12
8
|
|
13
|
-
|
14
|
-
|
9
|
+
unless readable.id
|
10
|
+
raise ArgumentError, "The given #{readable.class} has no id."
|
11
|
+
end
|
15
12
|
end
|
16
13
|
end
|
17
14
|
|
data/lib/unread/version.rb
CHANGED
data/spec/base_spec.rb
CHANGED
data/spec/model/email.rb
CHANGED
data/spec/read_mark_spec.rb
CHANGED
data/spec/readable_spec.rb
CHANGED
@@ -157,14 +157,13 @@ describe Unread::Readable do
|
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
160
|
-
|
161
160
|
describe :with_read_marks_for do
|
162
161
|
it "should return readables" do
|
163
162
|
expect(Email.with_read_marks_for(@reader).to_a).to eq([@email1, @email2])
|
164
163
|
end
|
165
164
|
|
166
165
|
it "should be countable" do
|
167
|
-
expect(Email.with_read_marks_for(@reader).count(:
|
166
|
+
expect(Email.with_read_marks_for(@reader).count(:uid)).to eq(2)
|
168
167
|
end
|
169
168
|
|
170
169
|
it "should not allow invalid parameter" do
|
data/spec/spec_helper.rb
CHANGED
@@ -70,7 +70,8 @@ def setup_db
|
|
70
70
|
t.string :name
|
71
71
|
end
|
72
72
|
|
73
|
-
create_table :
|
73
|
+
create_table :documents, :primary_key => 'uid', :force => true do |t|
|
74
|
+
t.string :type
|
74
75
|
t.string :subject
|
75
76
|
t.text :content
|
76
77
|
t.datetime :created_at
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unread
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Georg Ledermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|