mark_as_read 0.0.1 → 0.0.2
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/README.md +11 -10
- data/lib/mark_as_read/engine.rb +0 -1
- data/lib/mark_as_read/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 851f658fb57204d5c63b559f7ec99557ca021c83
|
4
|
+
data.tar.gz: 13340ffccb6f0379c9b71d8507044beb554edbbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e86219c608d612e583cf44a2a00d1c541392eae43ab38597920b3e331aa1e08a8dd2ed015746f619ce0921f0d1f13257c594d816fb4c5bf2da4806bc0213f7e9
|
7
|
+
data.tar.gz: 7f34462de0c3dce0b847ae0728fe1a9d06734bd9d78e437fb55f28cb853e9bb491bd78552325bde95a76d88b9d4332111a2038f9696ce44f2bb28bfb8ed6335b
|
data/README.md
CHANGED
@@ -20,23 +20,24 @@ Or install it yourself as:
|
|
20
20
|
## Usage
|
21
21
|
|
22
22
|
Let's say you have a ``Message`` class, simply add the following to describe the behavior to execute when a message is read:
|
23
|
+
````ruby
|
24
|
+
class Message < ActiveRecord::Base
|
23
25
|
|
24
|
-
|
26
|
+
include MarkAsRead::Readable
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
message.update_attributes(:read => true)
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
28
|
+
mark_as_read do |message|
|
29
|
+
message.update_attributes(:read => true)
|
30
|
+
end
|
33
31
|
|
32
|
+
end
|
33
|
+
````
|
34
34
|
The read message is yielded to the ``mark_as_read`` function so you can do anything you want on it.
|
35
35
|
|
36
36
|
|
37
37
|
Then, in your mailer view, you just have to add the tracking image, let's assume you have the message in the ``@message`` variable :
|
38
|
-
|
39
|
-
|
38
|
+
````ruby
|
39
|
+
<%= mark_as_read_img(@message) %>
|
40
|
+
````
|
40
41
|
|
41
42
|
## Disclaimer
|
42
43
|
|
data/lib/mark_as_read/engine.rb
CHANGED
data/lib/mark_as_read/version.rb
CHANGED