mailboxer 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -184,7 +184,7 @@ end
184
184
 
185
185
  ### How can I paginate conversations?
186
186
 
187
- 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.
187
+ 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.
188
188
 
189
189
  ````ruby
190
190
  #Paginating all conversations using :page parameter and 9 per page
@@ -220,7 +220,11 @@ This is done this way because receipts save the information about the relation b
220
220
  You can take a look at the full documentation of Mailboxer in [rubydoc.info](http://rubydoc.info/gems/mailboxer/frames).
221
221
 
222
222
  ## I need a GUI!
223
- Check out the [rails-messaging](https://github.com/frodefi/rails-messaging) project.
223
+
224
+ If you need a GUI you should take a look a this links:
225
+
226
+ * The [rails-messaging](https://github.com/frodefi/rails-messaging) project.
227
+ * The wiki page [GUI Example on a real application](https://github.com/ging/mailboxer/wiki/GUI-Example-on-a-real-application).
224
228
 
225
229
  ## Contributors
226
230
  * [Roendal](https://github.com/ging/mailboxer/commits/master?author=Roendal) (Eduardo Casanova)
@@ -0,0 +1,5 @@
1
+ class AddAttachments < ActiveRecord::Migration
2
+ def change
3
+ add_column :notifications, :attachment, :string
4
+ end
5
+ end
@@ -17,13 +17,16 @@ class Mailboxer::InstallGenerator < Rails::Generators::Base #:nodoc:
17
17
  end
18
18
 
19
19
  def copy_migrations
20
- migrations = ["create_mailboxer.rb","add_notified_object.rb","add_notification_code.rb","add_attachments.rb"]
20
+ migrations = [["20110511145103_create_mailboxer.rb","create_mailboxer.rb"],
21
+ ["20110719110700_add_notified_object.rb","add_notified_object.rb"],
22
+ ["20110912163911_add_notification_code.rb","add_notification_code.rb"],
23
+ ["20111204163911_add_attachments.rb","add_attachments.rb"]]
21
24
  migrations.each do |migration|
22
- begin
23
- migration_template migration, "db/migrate/" + migration
24
- rescue
25
- puts "Another migration is already named '" + migration + "'. Moving to next one."
26
- end
25
+ # begin
26
+ migration_template "../../../../db/migrate/" + migration[0], "db/migrate/" + migration[1]
27
+ # rescue
28
+ # puts "Another migration is already named '" + migration + "'. Moving to next one."
29
+ # end
27
30
  end
28
31
  end
29
32
  end
@@ -1,7 +1,11 @@
1
1
  # Database foreign keys
2
2
  require 'foreigner'
3
3
  require 'carrierwave'
4
- require 'sunspot_rails'
4
+ begin
5
+ require 'sunspot_rails'
6
+ rescue LoadError
7
+ puts 'Not loading sunspot_rails. Gem not present.'
8
+ end
5
9
 
6
10
  module Mailboxer
7
11
  class Engine < Rails::Engine
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "mailboxer"
3
- s.version = "0.6.2"
3
+ s.version = "0.6.3"
4
4
  s.authors = ["Eduardo Casanova Cuesta"]
5
5
  s.summary = "Messaging system for rails apps."
6
- s.description = "A Rails engine that allows any model to act as messageable, allowing it to exchange messages " +
6
+ s.description = "A Rails engine that allows any model to act as messageable, adding the ability to exchange messages " +
7
7
  "with any other messageable model, even different ones. It supports the use of conversations with " +
8
8
  "two or more recipients to organize the messages. You have a complete use of a mailbox object for " +
9
9
  "each messageable model that manages an inbox, sentbox and trash for conversations. It also supports " +
@@ -27,14 +27,11 @@ Gem::Specification.new do |s|
27
27
  # Specs
28
28
  s.add_development_dependency('rspec-rails', '>= 2.6.1')
29
29
  # Fixtures
30
- s.add_development_dependency('factory_girl', '>= 1.3.2')
30
+ s.add_development_dependency('factory_girl', '>= 2.6.0')
31
31
  # Population
32
32
  s.add_development_dependency('forgery', '>= 0.3.6')
33
33
  # Integration testing
34
34
  s.add_development_dependency('capybara', '>= 0.3.9')
35
- # Searching
36
- s.add_development_dependency('sunspot_rails', '>= 1.3.0')
37
- s.add_development_dependency('sunspot_solr', '>= 1.3.0')
38
35
  # Testing database
39
36
  s.add_development_dependency('sqlite3-ruby') unless RUBY_PLATFORM == 'java'
40
37
  s.add_development_dependency('jdbc-sqlite3') if RUBY_PLATFORM == 'java'
@@ -2,6 +2,7 @@ source 'http://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 3.0.0'
4
4
  gem 'mailboxer', :path => '../../'
5
+ gem 'factory_girl'
5
6
 
6
7
  # Bundle edge Rails instead:
7
8
  # gem 'rails', :git => 'git://github.com/rails/rails.git'
@@ -14,4 +14,4 @@ Mailboxer.setup do |config|
14
14
  #Supported enignes: [:solr,:sphinx]
15
15
  config.search_enabled = false
16
16
  config.search_engine = :solr
17
- end
17
+ end
@@ -0,0 +1,5 @@
1
+ class AddAttachments < ActiveRecord::Migration
2
+ def change
3
+ add_column :notifications, :attachment, :string
4
+ end
5
+ end
@@ -0,0 +1,74 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended to check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(:version => 20120305103203) do
14
+
15
+ create_table "conversations", :force => true do |t|
16
+ t.string "subject", :default => ""
17
+ t.datetime "created_at", :null => false
18
+ t.datetime "updated_at", :null => false
19
+ end
20
+
21
+ create_table "cylons", :force => true do |t|
22
+ t.string "name"
23
+ t.string "email"
24
+ t.datetime "created_at", :null => false
25
+ t.datetime "updated_at", :null => false
26
+ end
27
+
28
+ create_table "ducks", :force => true do |t|
29
+ t.string "name"
30
+ t.string "email"
31
+ t.datetime "created_at", :null => false
32
+ t.datetime "updated_at", :null => false
33
+ end
34
+
35
+ create_table "notifications", :force => true do |t|
36
+ t.string "type"
37
+ t.text "body"
38
+ t.string "subject", :default => ""
39
+ t.integer "sender_id"
40
+ t.string "sender_type"
41
+ t.integer "conversation_id"
42
+ t.boolean "draft", :default => false
43
+ t.datetime "updated_at", :null => false
44
+ t.datetime "created_at", :null => false
45
+ t.integer "notified_object_id"
46
+ t.string "notified_object_type"
47
+ t.string "notification_code"
48
+ t.string "attachment"
49
+ end
50
+
51
+ add_index "notifications", ["conversation_id"], :name => "index_notifications_on_conversation_id"
52
+
53
+ create_table "receipts", :force => true do |t|
54
+ t.integer "receiver_id"
55
+ t.string "receiver_type"
56
+ t.integer "notification_id", :null => false
57
+ t.boolean "read", :default => false
58
+ t.boolean "trashed", :default => false
59
+ t.boolean "deleted", :default => false
60
+ t.string "mailbox_type", :limit => 25
61
+ t.datetime "created_at", :null => false
62
+ t.datetime "updated_at", :null => false
63
+ end
64
+
65
+ add_index "receipts", ["notification_id"], :name => "index_receipts_on_notification_id"
66
+
67
+ create_table "users", :force => true do |t|
68
+ t.string "name"
69
+ t.string "email"
70
+ t.datetime "created_at", :null => false
71
+ t.datetime "updated_at", :null => false
72
+ end
73
+
74
+ end
@@ -1,4 +1,10 @@
1
- Factory.define :cylon do |c|
2
- c.sequence(:name) { |n| "Cylon #{ n }" }
3
- c.sequence(:email) { |n| "cylon#{ n }@cylon.com" }
1
+ FactoryGirl.define do
2
+ factory :cylon do
3
+ sequence :name do |n|
4
+ "Cylon #{ n }"
5
+ end
6
+ sequence :email do |n|
7
+ "cylon#{ n }@cylon.com"
8
+ end
9
+ end
4
10
  end
@@ -1,4 +1,10 @@
1
- Factory.define :duck do |d|
2
- d.sequence(:name) { |n| "Duck #{ n }" }
3
- d.sequence(:email) { |n| "duck#{ n }@duck.com" }
4
- end
1
+ FactoryGirl.define do
2
+ factory :duck do
3
+ sequence :name do |n|
4
+ "Duck #{ n }"
5
+ end
6
+ sequence :email do |n|
7
+ "duck#{ n }@duck.com"
8
+ end
9
+ end
10
+ end
@@ -1,4 +1,10 @@
1
- Factory.define :user do |u|
2
- u.sequence(:name) { |n| "User #{ n }" }
3
- u.sequence(:email) { |n| "user#{ n }@user.com" }
1
+ FactoryGirl.define do
2
+ factory :user do
3
+ sequence :name do |n|
4
+ "User #{ n }"
5
+ end
6
+ sequence :email do |n|
7
+ "user#{ n }@user.com"
8
+ end
9
+ end
4
10
  end
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: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 2
10
- version: 0.6.2
9
+ - 3
10
+ version: 0.6.3
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-03-04 00:00:00 Z
18
+ date: 2012-03-05 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: foreigner
@@ -105,12 +105,12 @@ dependencies:
105
105
  requirements:
106
106
  - - ">="
107
107
  - !ruby/object:Gem::Version
108
- hash: 31
108
+ hash: 23
109
109
  segments:
110
- - 1
111
- - 3
112
110
  - 2
113
- version: 1.3.2
111
+ - 6
112
+ - 0
113
+ version: 2.6.0
114
114
  type: :development
115
115
  version_requirements: *id006
116
116
  - !ruby/object:Gem::Dependency
@@ -145,42 +145,10 @@ dependencies:
145
145
  version: 0.3.9
146
146
  type: :development
147
147
  version_requirements: *id008
148
- - !ruby/object:Gem::Dependency
149
- name: sunspot_rails
150
- prerelease: false
151
- requirement: &id009 !ruby/object:Gem::Requirement
152
- none: false
153
- requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- hash: 27
157
- segments:
158
- - 1
159
- - 3
160
- - 0
161
- version: 1.3.0
162
- type: :development
163
- version_requirements: *id009
164
- - !ruby/object:Gem::Dependency
165
- name: sunspot_solr
166
- prerelease: false
167
- requirement: &id010 !ruby/object:Gem::Requirement
168
- none: false
169
- requirements:
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- hash: 27
173
- segments:
174
- - 1
175
- - 3
176
- - 0
177
- version: 1.3.0
178
- type: :development
179
- version_requirements: *id010
180
148
  - !ruby/object:Gem::Dependency
181
149
  name: sqlite3-ruby
182
150
  prerelease: false
183
- requirement: &id011 !ruby/object:Gem::Requirement
151
+ requirement: &id009 !ruby/object:Gem::Requirement
184
152
  none: false
185
153
  requirements:
186
154
  - - ">="
@@ -190,8 +158,8 @@ dependencies:
190
158
  - 0
191
159
  version: "0"
192
160
  type: :development
193
- version_requirements: *id011
194
- description: A Rails engine that allows any model to act as messageable, allowing it to exchange messages with any other messageable model, even different ones. It supports the use of conversations with two or more recipients to organize the messages. You have a complete use of a mailbox object for each messageable model that manages an inbox, sentbox and trash for conversations. It also supports sending notifications to messageable models, intended to be used as system notifications.
161
+ version_requirements: *id009
162
+ description: A Rails engine that allows any model to act as messageable, adding the ability to exchange messages with any other messageable model, even different ones. It supports the use of conversations with two or more recipients to organize the messages. You have a complete use of a mailbox object for each messageable model that manages an inbox, sentbox and trash for conversations. It also supports sending notifications to messageable models, intended to be used as system notifications.
195
163
  email: ecasanovac@gmail.com
196
164
  executables: []
197
165
 
@@ -208,7 +176,6 @@ files:
208
176
  - LICENSE.txt
209
177
  - README.md
210
178
  - Rakefile
211
- - VERSION
212
179
  - app/mailers/message_mailer.rb
213
180
  - app/mailers/notification_mailer.rb
214
181
  - app/models/conversation.rb
@@ -224,11 +191,11 @@ files:
224
191
  - app/views/notification_mailer/new_notification_email.html.erb
225
192
  - app/views/notification_mailer/new_notification_email.text.erb
226
193
  - config/locales/en.yml
194
+ - db/migrate/20110511145103_create_mailboxer.rb
195
+ - db/migrate/20110719110700_add_notified_object.rb
196
+ - db/migrate/20110912163911_add_notification_code.rb
197
+ - db/migrate/20111204163911_add_attachments.rb
227
198
  - lib/generators/mailboxer/install_generator.rb
228
- - lib/generators/mailboxer/templates/add_attachments.rb
229
- - lib/generators/mailboxer/templates/add_notification_code.rb
230
- - lib/generators/mailboxer/templates/add_notified_object.rb
231
- - lib/generators/mailboxer/templates/create_mailboxer.rb
232
199
  - lib/generators/mailboxer/templates/initializer.rb
233
200
  - lib/generators/mailboxer/views_generator.rb
234
201
  - lib/mailboxer.rb
@@ -268,10 +235,11 @@ files:
268
235
  - spec/dummy/db/migrate/20110228120600_create_users.rb
269
236
  - spec/dummy/db/migrate/20110306002940_create_ducks.rb
270
237
  - spec/dummy/db/migrate/20110306015107_create_cylons.rb
271
- - spec/dummy/db/migrate/20120123185900_create_mailboxer.rb
272
- - spec/dummy/db/migrate/20120123185901_add_notified_object.rb
273
- - spec/dummy/db/migrate/20120123185902_add_notification_code.rb
274
- - spec/dummy/db/migrate/20120123185903_add_attachments.rb
238
+ - spec/dummy/db/migrate/20120305103200_create_mailboxer.rb
239
+ - spec/dummy/db/migrate/20120305103201_add_notified_object.rb
240
+ - spec/dummy/db/migrate/20120305103202_add_notification_code.rb
241
+ - spec/dummy/db/migrate/20120305103203_add_attachments.rb
242
+ - spec/dummy/db/schema.rb
275
243
  - spec/dummy/public/404.html
276
244
  - spec/dummy/public/422.html
277
245
  - spec/dummy/public/500.html
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.1
@@ -1,13 +0,0 @@
1
- class AddAttachments < ActiveRecord::Migration
2
- def self.up
3
- change_table :notifications do |t|
4
- t.string :attachment, :default => nil
5
- end
6
- end
7
-
8
- def self.down
9
- change_table :notifications do |t|
10
- t.remove :attachment
11
- end
12
- end
13
- end
@@ -1,13 +0,0 @@
1
- class AddAttachments < ActiveRecord::Migration
2
- def self.up
3
- change_table :notifications do |t|
4
- t.string :attachment, :default => nil
5
- end
6
- end
7
-
8
- def self.down
9
- change_table :notifications do |t|
10
- t.remove :attachment
11
- end
12
- end
13
- end