mailboxer 0.1.0 → 0.1.1
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/VERSION +1 -1
- data/lib/mailboxer/models/messageable.rb +21 -28
- data/mailboxer.gemspec +1 -1
- metadata +4 -5
- data/spec/dummy/db/schema.rb +0 -70
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -12,39 +12,32 @@ module Mailboxer
|
|
12
12
|
has_many :messages
|
13
13
|
has_many :receipts, :order => 'created_at DESC', :dependent => :delete_all
|
14
14
|
|
15
|
-
if self.table_exists?
|
16
|
-
if !self.new.respond_to? :name
|
17
|
-
self.class_eval do
|
18
|
-
#Returning any kind of indentification you want for the model
|
19
|
-
def name
|
20
|
-
return "You should add method :name in your Messageable model"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
if !self.new.respond_to? :email
|
26
|
-
self.class_eval do
|
27
|
-
#Returning the email address of the model
|
28
|
-
def email
|
29
|
-
return "define_email@on_your.model"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
if !self.new.respond_to? :should_email?
|
35
|
-
self.class_eval do
|
36
|
-
#Returning whether an email should be sent for this object (Message or Notification)
|
37
|
-
def should_email?(object)
|
38
|
-
return true
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
15
|
include Mailboxer::Models::Messageable::InstanceMethods
|
44
16
|
end
|
45
17
|
end
|
46
18
|
|
47
19
|
module InstanceMethods
|
20
|
+
#Returning any kind of indentification you want for the model
|
21
|
+
def name
|
22
|
+
super
|
23
|
+
rescue
|
24
|
+
return "You should add method :name in your Messageable model"
|
25
|
+
end
|
26
|
+
|
27
|
+
#Returning the email address of the model
|
28
|
+
def email
|
29
|
+
super
|
30
|
+
rescue
|
31
|
+
return "define_email@on_your.model"
|
32
|
+
end
|
33
|
+
|
34
|
+
#Returning whether an email should be sent for this object (Message or Notification)
|
35
|
+
def should_email?(object)
|
36
|
+
super
|
37
|
+
rescue
|
38
|
+
return true
|
39
|
+
end
|
40
|
+
|
48
41
|
#Gets the mailbox of the messageable
|
49
42
|
def mailbox
|
50
43
|
@mailbox = Mailbox.new(self) if @mailbox.nil?
|
data/mailboxer.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "mailboxer"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.1"
|
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, permitting it interchange messages with any other messageable model." +
|
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: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
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: 2011-04-
|
18
|
+
date: 2011-04-28 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -211,7 +211,6 @@ files:
|
|
211
211
|
- spec/dummy/db/migrate/20110306002940_create_ducks.rb
|
212
212
|
- spec/dummy/db/migrate/20110306015107_create_cylons.rb
|
213
213
|
- spec/dummy/db/migrate/20110427123542_create_mailboxer.rb
|
214
|
-
- spec/dummy/db/schema.rb
|
215
214
|
- spec/dummy/public/404.html
|
216
215
|
- spec/dummy/public/422.html
|
217
216
|
- spec/dummy/public/500.html
|
data/spec/dummy/db/schema.rb
DELETED
@@ -1,70 +0,0 @@
|
|
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 => 20110427123542) 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"
|
25
|
-
t.datetime "updated_at"
|
26
|
-
end
|
27
|
-
|
28
|
-
create_table "ducks", :force => true do |t|
|
29
|
-
t.string "name"
|
30
|
-
t.string "email"
|
31
|
-
t.datetime "created_at"
|
32
|
-
t.datetime "updated_at"
|
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
|
-
end
|
46
|
-
|
47
|
-
add_index "notifications", ["conversation_id"], :name => "index_notifications_on_conversation_id"
|
48
|
-
|
49
|
-
create_table "receipts", :force => true do |t|
|
50
|
-
t.integer "receiver_id"
|
51
|
-
t.string "receiver_type"
|
52
|
-
t.integer "notification_id", :null => false
|
53
|
-
t.boolean "read", :default => false
|
54
|
-
t.boolean "trashed", :default => false
|
55
|
-
t.boolean "deleted", :default => false
|
56
|
-
t.string "mailbox_type", :limit => 25
|
57
|
-
t.datetime "created_at", :null => false
|
58
|
-
t.datetime "updated_at", :null => false
|
59
|
-
end
|
60
|
-
|
61
|
-
add_index "receipts", ["notification_id"], :name => "index_receipts_on_notification_id"
|
62
|
-
|
63
|
-
create_table "users", :force => true do |t|
|
64
|
-
t.string "name"
|
65
|
-
t.string "email"
|
66
|
-
t.datetime "created_at"
|
67
|
-
t.datetime "updated_at"
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|