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 CHANGED
@@ -1,4 +1,4 @@
1
- h1. Mailboxer 0.5.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
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.
@@ -46,7 +46,7 @@ class Mailbox
46
46
  conv = conv.unread(@messageable)
47
47
  end
48
48
 
49
- return conv.uniq
49
+ return conv
50
50
  end
51
51
 
52
52
  #Returns the conversations in the inbox of messageable
@@ -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 :name in your Messageable model"
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 "define_email@on_your.model"
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.5.5"
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: 1
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 5
9
- - 5
10
- version: 0.5.5
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-19 00:00:00 Z
18
+ date: 2012-01-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  type: :runtime