mailboxer 0.5.5 → 0.6.0
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.
- data/README.textile +15 -1
- data/app/models/mailbox.rb +1 -1
- data/lib/mailboxer/models/messageable.rb +2 -2
- data/mailboxer.gemspec +1 -1
- metadata +5 -5
data/README.textile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
h1. Mailboxer 0.
|
1
|
+
h1. Mailboxer 0.6.x "!https://secure.travis-ci.org/ging/mailboxer.png!":http://travis-ci.org/ging/mailboxer "!https://gemnasium.com/ging/mailboxer.png!":https://gemnasium.com/ging/mailboxer
|
2
2
|
|
3
3
|
This project is based on the need of a private message system for "ging / social_stream":https://github.com/ging/social_stream. Instead of creating our core message system heavily dependent on our development we are trying to implement a generic and potent messaging gem.
|
4
4
|
|
@@ -146,6 +146,20 @@ h3. How can I retrieve my conversations?
|
|
146
146
|
alfa.mailbox.trash
|
147
147
|
</code></pre>
|
148
148
|
|
149
|
+
h3. How can I paginate conversations?
|
150
|
+
|
151
|
+
You can use Kaminari to paginate the conversations as normal. Please, make sure you use the last version as mailboxer uses @select('DISTINCT conversations.*')@ which was not respected before Kaminari 0.12.4 according to its changelog. Working corretly on Kaminari 0.13.0.
|
152
|
+
<pre><code>
|
153
|
+
#Paginating all conversations using :page parameter and 9 per page
|
154
|
+
conversations = alfa.mailbox.conversations.page(params[:page]).per(9)
|
155
|
+
#Paginating received conversations using :page parameter and 9 per page
|
156
|
+
conversations = alfa.mailbox.inbox.page(params[:page]).per(9)
|
157
|
+
#Paginating sent conversations using :page parameter and 9 per page
|
158
|
+
conversations = alfa.mailbox.sentbox.page(params[:page]).per(9)
|
159
|
+
#Paginating trashed conversations using :page parameter and 9 per page
|
160
|
+
conversations = alfa.mailbox.trash.page(params[:page]).per(9)
|
161
|
+
</code></pre>
|
162
|
+
|
149
163
|
h3. How can I read the messages of a conversation?
|
150
164
|
|
151
165
|
As a messageable, what you receive receipts wich are linked with the message itself. You should retrieve your receipts for the conversation a get the message associated to them.
|
data/app/models/mailbox.rb
CHANGED
@@ -22,7 +22,7 @@ module Mailboxer
|
|
22
22
|
def #{Mailboxer.name_method}
|
23
23
|
super
|
24
24
|
rescue NameError
|
25
|
-
return "You should add method
|
25
|
+
return "You should add method :#{Mailboxer.name_method} in your Messageable model"
|
26
26
|
end
|
27
27
|
|
28
28
|
#Returning the email address of the model if an email should be sent for this object (Message or Notification).
|
@@ -30,7 +30,7 @@ module Mailboxer
|
|
30
30
|
def #{Mailboxer.email_method}(object)
|
31
31
|
super
|
32
32
|
rescue NameError
|
33
|
-
return "
|
33
|
+
return "You should add method :#{Mailboxer.email_method} in your Messageable model"
|
34
34
|
end
|
35
35
|
EOM
|
36
36
|
#Gets the mailbox of the messageable
|
data/mailboxer.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "mailboxer"
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.6.0"
|
4
4
|
s.authors = ["Eduardo Casanova Cuesta"]
|
5
5
|
s.summary = "Messaging system for rails apps."
|
6
6
|
s.description = "A Rails engine that allows any model to act as messageable, allowing it to exchange messages " +
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailboxer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Eduardo Casanova Cuesta
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-20 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
type: :runtime
|