acts_as_messenger 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/acts_as_messenger.gemspec +2 -4
- data/generators/acts_as_messenger/acts_as_messenger_generator.rb +1 -1
- data/generators/acts_as_messenger/templates/migrations/acts_as_messenger_migration.rb +44 -0
- metadata +2 -4
- data/generators/acts_as_messenger/templates/migrations/create_comments.rb +0 -19
- data/generators/acts_as_messenger/templates/migrations/create_message_threads.rb +0 -19
- data/generators/acts_as_messenger/templates/migrations/create_recipients.rb +0 -20
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/acts_as_messenger.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{acts_as_messenger}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mike Nelson"]
|
@@ -25,9 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
"VERSION",
|
26
26
|
"acts_as_messenger.gemspec",
|
27
27
|
"generators/acts_as_messenger/acts_as_messenger_generator.rb",
|
28
|
-
"generators/acts_as_messenger/templates/migrations/
|
29
|
-
"generators/acts_as_messenger/templates/migrations/create_message_threads.rb",
|
30
|
-
"generators/acts_as_messenger/templates/migrations/create_recipients.rb",
|
28
|
+
"generators/acts_as_messenger/templates/migrations/acts_as_messenger_migration.rb",
|
31
29
|
"generators/acts_as_messenger/templates/models/comment.rb",
|
32
30
|
"generators/acts_as_messenger/templates/models/message_thread.rb",
|
33
31
|
"generators/acts_as_messenger/templates/models/recipient.rb",
|
@@ -5,8 +5,8 @@ class ActsAsMessengerGenerator < Rails::Generator::Base
|
|
5
5
|
|
6
6
|
%w(comment message_thread recipient).each do |model|
|
7
7
|
m.file "models/#{model}.rb", "app/models/#{model}.rb"
|
8
|
-
m.migration_template "migrations/create_#{model.pluralize}.rb", "db/migrate"
|
9
8
|
end
|
9
|
+
m.migration_template "migrations/acts_as_messenger_migration.rb", "db/migrate"
|
10
10
|
|
11
11
|
end
|
12
12
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
class CreateComments < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def self.up
|
4
|
+
create_table :comments do |t|
|
5
|
+
t.references :commentable, :polymorphic => true
|
6
|
+
t.integer :author_id
|
7
|
+
t.text :body
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
|
11
|
+
add_index :comments, :author_id
|
12
|
+
add_index :comments, [:commentable_id, :commentable_type]
|
13
|
+
|
14
|
+
create_table :message_threads do |t|
|
15
|
+
t.integer :author_id
|
16
|
+
t.string :title
|
17
|
+
t.text :body
|
18
|
+
t.boolean :private_thread, :default => true
|
19
|
+
t.timestamps
|
20
|
+
end
|
21
|
+
|
22
|
+
add_index :message_threads, :author_id
|
23
|
+
|
24
|
+
create_table :recipients do |t|
|
25
|
+
t.references :receiver, :polymorphic => true
|
26
|
+
t.references :message_thread
|
27
|
+
t.boolean :has_read
|
28
|
+
t.timestamps
|
29
|
+
end
|
30
|
+
|
31
|
+
add_index :recipients, :message_thread_id
|
32
|
+
add_index :recipients, [:receiver_id, :receiver_type]
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.down
|
37
|
+
|
38
|
+
drop_table :recipients
|
39
|
+
drop_table :message_threads
|
40
|
+
drop_table :comments
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_messenger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Nelson
|
@@ -50,9 +50,7 @@ files:
|
|
50
50
|
- VERSION
|
51
51
|
- acts_as_messenger.gemspec
|
52
52
|
- generators/acts_as_messenger/acts_as_messenger_generator.rb
|
53
|
-
- generators/acts_as_messenger/templates/migrations/
|
54
|
-
- generators/acts_as_messenger/templates/migrations/create_message_threads.rb
|
55
|
-
- generators/acts_as_messenger/templates/migrations/create_recipients.rb
|
53
|
+
- generators/acts_as_messenger/templates/migrations/acts_as_messenger_migration.rb
|
56
54
|
- generators/acts_as_messenger/templates/models/comment.rb
|
57
55
|
- generators/acts_as_messenger/templates/models/message_thread.rb
|
58
56
|
- generators/acts_as_messenger/templates/models/recipient.rb
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class CreateComments < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def self.up
|
4
|
-
create_table :comments do |t|
|
5
|
-
t.references :commentable, :polymorphic => true
|
6
|
-
t.integer :author_id
|
7
|
-
t.text :body
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
|
11
|
-
add_index :comments, :author_id
|
12
|
-
add_index :comments, [:commentable_id, :commentable_type]
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.down
|
16
|
-
drop_table :comments
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class CreateMessageThreads < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def self.up
|
4
|
-
create_table :message_threads do |t|
|
5
|
-
t.integer :author_id
|
6
|
-
t.string :title
|
7
|
-
t.text :body
|
8
|
-
t.boolean :private_thread, :default => true
|
9
|
-
t.timestamps
|
10
|
-
end
|
11
|
-
|
12
|
-
add_index :message_threads, :author_id
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.down
|
16
|
-
drop_table :message_threads
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
class CreateRecipients < ActiveRecord::Migration
|
2
|
-
|
3
|
-
def self.up
|
4
|
-
create_table :recipients do |t|
|
5
|
-
t.references :receiver, :polymorphic => true
|
6
|
-
t.references :message_thread
|
7
|
-
t.boolean :has_read
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
|
11
|
-
add_index :recipients, :message_thread_id
|
12
|
-
add_index :recipients, [:receiver_id, :receiver_type]
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.down
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|