message_train 0.6.17 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +16 -13
- data/.rubocop_todo.yml +12 -0
- data/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/Gemfile +28 -30
- data/README.md +284 -0
- data/Rakefile +6 -7
- data/VERSION +1 -1
- data/app/assets/javascripts/ckeditor/{config.js.coffee → config.js} +7 -6
- data/app/assets/stylesheets/message_train.scss +0 -8
- data/app/controllers/concerns/message_train_authorization.rb +37 -0
- data/app/controllers/concerns/message_train_support.rb +41 -69
- data/app/controllers/message_train/application_controller.rb +1 -0
- data/app/controllers/message_train/boxes_controller.rb +5 -4
- data/app/controllers/message_train/conversations_controller.rb +7 -5
- data/app/controllers/message_train/messages_controller.rb +43 -27
- data/app/controllers/message_train/participants_controller.rb +14 -25
- data/app/controllers/message_train/unsubscribes_controller.rb +96 -61
- data/app/helpers/message_train/application_helper.rb +13 -7
- data/app/helpers/message_train/attachments_helper.rb +4 -12
- data/app/helpers/message_train/boxes_helper.rb +4 -14
- data/app/helpers/message_train/collectives_helper.rb +23 -29
- data/app/helpers/message_train/conversations_helper.rb +52 -30
- data/app/helpers/message_train/messages_helper.rb +33 -20
- data/app/mailers/message_train/receipt_mailer.rb +22 -12
- data/app/models/message_train/attachment.rb +2 -2
- data/app/models/message_train/box.rb +182 -228
- data/app/models/message_train/conversation.rb +100 -103
- data/app/models/message_train/ignore.rb +83 -4
- data/app/models/message_train/message.rb +66 -117
- data/app/models/message_train/receipt.rb +73 -49
- data/app/views/message_train/boxes/show.html.haml +11 -7
- data/config/locales/en.yml +1 -0
- data/config/routes.rb +6 -12
- data/lib/message_train.rb +3 -1
- data/lib/message_train/class_methods.rb +51 -0
- data/lib/message_train/configuration.rb +28 -3
- data/lib/message_train/instance_methods.rb +209 -0
- data/lib/message_train/mixin.rb +25 -320
- data/message_train.gemspec +83 -83
- data/spec/controllers/message_train/boxes_controller_spec.rb +37 -19
- data/spec/controllers/message_train/concerns_spec.rb +21 -3
- data/spec/controllers/message_train/conversations_controller_spec.rb +41 -18
- data/spec/controllers/message_train/messages_controller_spec.rb +112 -31
- data/spec/controllers/message_train/participants_controller_spec.rb +33 -7
- data/spec/controllers/message_train/unsubscribes_controller_spec.rb +10 -8
- data/spec/dummy/app/assets/stylesheets/{application.css.scss → application.scss} +2 -1
- data/spec/dummy/app/assets/stylesheets/bootstrap-everything.scss +54 -0
- data/spec/dummy/app/models/group.rb +1 -1
- data/spec/dummy/app/views/layouts/application.html.haml +9 -8
- data/spec/dummy/bin/setup +8 -8
- data/spec/dummy/config/application.rb +0 -3
- data/spec/dummy/config/environments/test.rb +4 -2
- data/spec/dummy/db/schema.rb +94 -103
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/factories/attachment.rb +3 -1
- data/spec/factories/message.rb +2 -3
- data/spec/features/boxes_spec.rb +0 -3
- data/spec/helpers/message_train/application_helper_spec.rb +3 -2
- data/spec/helpers/message_train/attachment_helper_spec.rb +4 -0
- data/spec/helpers/message_train/boxes_helper_spec.rb +1 -0
- data/spec/helpers/message_train/collectives_helper_spec.rb +1 -0
- data/spec/helpers/message_train/conversations_helper_spec.rb +3 -2
- data/spec/helpers/message_train/messages_helper_spec.rb +2 -1
- data/spec/models/group_spec.rb +6 -4
- data/spec/models/message_train/box_spec.rb +0 -88
- data/spec/models/message_train/ignore_spec.rb +65 -0
- data/spec/models/message_train/message_spec.rb +6 -5
- data/spec/models/message_train/receipt_spec.rb +6 -8
- data/spec/models/role_spec.rb +2 -2
- data/spec/models/user_spec.rb +29 -101
- data/spec/rails_helper.rb +16 -30
- data/spec/support/feature_behaviors.rb +2 -1
- data/spec/support/shared_connection.rb +5 -0
- data/spec/support/utilities.rb +7 -8
- metadata +145 -120
- data/README.rdoc +0 -175
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
@@ -12,7 +12,13 @@ describe MessageTrain::ParticipantsController do
|
|
12
12
|
describe 'GET #index' do
|
13
13
|
describe 'with model to users' do
|
14
14
|
before do
|
15
|
-
get
|
15
|
+
get(
|
16
|
+
:index,
|
17
|
+
params: {
|
18
|
+
box_division: 'in', model: 'users'
|
19
|
+
},
|
20
|
+
format: :json
|
21
|
+
)
|
16
22
|
end
|
17
23
|
it_should_behave_like 'a successful page', which_renders: 'index'
|
18
24
|
|
@@ -24,7 +30,13 @@ describe MessageTrain::ParticipantsController do
|
|
24
30
|
describe 'with model set to groups' do
|
25
31
|
describe 'given model responds to fallback method' do
|
26
32
|
before do
|
27
|
-
get
|
33
|
+
get(
|
34
|
+
:index,
|
35
|
+
params: {
|
36
|
+
box_division: 'in', model: 'groups'
|
37
|
+
},
|
38
|
+
format: :json
|
39
|
+
)
|
28
40
|
end
|
29
41
|
it_should_behave_like 'a successful page', which_renders: 'index'
|
30
42
|
|
@@ -37,7 +49,13 @@ describe MessageTrain::ParticipantsController do
|
|
37
49
|
describe 'given model does not fallback method' do
|
38
50
|
before do
|
39
51
|
MessageTrain.configuration.address_book_method = nil
|
40
|
-
get
|
52
|
+
get(
|
53
|
+
:index,
|
54
|
+
params: {
|
55
|
+
box_division: 'in', model: 'groups'
|
56
|
+
},
|
57
|
+
format: :json
|
58
|
+
)
|
41
59
|
end
|
42
60
|
it_should_behave_like 'a successful page', which_renders: 'index'
|
43
61
|
|
@@ -50,7 +68,13 @@ describe MessageTrain::ParticipantsController do
|
|
50
68
|
end
|
51
69
|
describe 'with no model set' do
|
52
70
|
before do
|
53
|
-
get
|
71
|
+
get(
|
72
|
+
:index,
|
73
|
+
params: {
|
74
|
+
box_division: 'in', model: ''
|
75
|
+
},
|
76
|
+
format: :json
|
77
|
+
)
|
54
78
|
end
|
55
79
|
it_should_behave_like 'a 404 Not Found error'
|
56
80
|
end
|
@@ -60,9 +84,11 @@ describe MessageTrain::ParticipantsController do
|
|
60
84
|
before do
|
61
85
|
get(
|
62
86
|
:show,
|
63
|
-
|
64
|
-
|
65
|
-
|
87
|
+
params: {
|
88
|
+
box_division: 'in',
|
89
|
+
model: 'users',
|
90
|
+
id: first_user.id
|
91
|
+
},
|
66
92
|
format: :json
|
67
93
|
)
|
68
94
|
end
|
@@ -33,13 +33,13 @@ describe MessageTrain::UnsubscribesController do
|
|
33
33
|
describe 'POST #create' do
|
34
34
|
describe 'with invalid attributes' do
|
35
35
|
before do
|
36
|
-
post :create, unsubscribe: invalid_attributes
|
36
|
+
post :create, params: { unsubscribe: invalid_attributes }
|
37
37
|
end
|
38
38
|
it_should_behave_like 'a 404 Not Found error'
|
39
39
|
end
|
40
40
|
describe 'with valid attributes' do
|
41
41
|
before do
|
42
|
-
post :create, unsubscribe: valid_attributes
|
42
|
+
post :create, params: { unsubscribe: valid_attributes }
|
43
43
|
end
|
44
44
|
it_should_behave_like(
|
45
45
|
'a redirect with a message',
|
@@ -52,7 +52,7 @@ describe MessageTrain::UnsubscribesController do
|
|
52
52
|
end
|
53
53
|
describe 'with :all set to true' do
|
54
54
|
before do
|
55
|
-
post :create, all: true
|
55
|
+
post :create, params: { all: true }
|
56
56
|
end
|
57
57
|
it_should_behave_like(
|
58
58
|
'a redirect with a message',
|
@@ -70,10 +70,12 @@ describe MessageTrain::UnsubscribesController do
|
|
70
70
|
before do
|
71
71
|
delete(
|
72
72
|
:destroy,
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
73
|
+
params: {
|
74
|
+
id: first_user.unsubscribes.where(
|
75
|
+
from_type: 'Group',
|
76
|
+
from_id: unsubscribed_group.id
|
77
|
+
).first.id
|
78
|
+
}
|
77
79
|
)
|
78
80
|
end
|
79
81
|
it_should_behave_like(
|
@@ -86,7 +88,7 @@ describe MessageTrain::UnsubscribesController do
|
|
86
88
|
end
|
87
89
|
describe 'with :all set to true' do
|
88
90
|
before do
|
89
|
-
delete :destroy, all: true
|
91
|
+
delete :destroy, params: { all: true }
|
90
92
|
end
|
91
93
|
it_should_behave_like(
|
92
94
|
'a redirect with a message',
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/*!
|
2
|
+
* This file exists to fix a naming conflict.
|
3
|
+
*/
|
4
|
+
|
5
|
+
// Core variables and mixins
|
6
|
+
@import 'bootstrap/variables';
|
7
|
+
@import 'bootstrap/mixins';
|
8
|
+
|
9
|
+
// Reset and dependencies
|
10
|
+
@import 'bootstrap/normalize';
|
11
|
+
@import 'bootstrap/print';
|
12
|
+
@import 'bootstrap/glyphicons';
|
13
|
+
|
14
|
+
// Core CSS
|
15
|
+
@import 'bootstrap/scaffolding';
|
16
|
+
@import 'bootstrap/type';
|
17
|
+
@import 'bootstrap/code';
|
18
|
+
@import 'bootstrap/grid';
|
19
|
+
@import 'bootstrap/tables';
|
20
|
+
@import 'bootstrap/forms';
|
21
|
+
@import 'bootstrap/buttons';
|
22
|
+
|
23
|
+
// Components
|
24
|
+
@import 'bootstrap/component-animations';
|
25
|
+
@import 'bootstrap/dropdowns';
|
26
|
+
@import 'bootstrap/button-groups';
|
27
|
+
@import 'bootstrap/input-groups';
|
28
|
+
@import 'bootstrap/navs';
|
29
|
+
@import 'bootstrap/navbar';
|
30
|
+
@import 'bootstrap/breadcrumbs';
|
31
|
+
@import 'bootstrap/pagination';
|
32
|
+
@import 'bootstrap/pager';
|
33
|
+
@import 'bootstrap/labels';
|
34
|
+
@import 'bootstrap/badges';
|
35
|
+
@import 'bootstrap/jumbotron';
|
36
|
+
@import 'bootstrap/thumbnails';
|
37
|
+
@import 'bootstrap/alerts';
|
38
|
+
@import 'bootstrap/progress-bars';
|
39
|
+
@import 'bootstrap/media';
|
40
|
+
@import 'bootstrap/list-group';
|
41
|
+
@import 'bootstrap/panels';
|
42
|
+
@import 'bootstrap/responsive-embed';
|
43
|
+
@import 'bootstrap/wells';
|
44
|
+
@import 'bootstrap/close';
|
45
|
+
|
46
|
+
// Components w/ JavaScript
|
47
|
+
@import 'bootstrap/modals';
|
48
|
+
@import 'bootstrap/tooltip';
|
49
|
+
@import 'bootstrap/popovers';
|
50
|
+
@import 'bootstrap/carousel';
|
51
|
+
|
52
|
+
// Utility classes
|
53
|
+
@import 'bootstrap/utilities';
|
54
|
+
@import 'bootstrap/responsive-utilities';
|
@@ -13,7 +13,7 @@ class Group < ActiveRecord::Base
|
|
13
13
|
# Callbacks
|
14
14
|
before_create :set_slug
|
15
15
|
|
16
|
-
scope :membered_by, ->(user) { with_roles([:member, :owner], user).
|
16
|
+
scope :membered_by, ->(user) { with_roles([:member, :owner], user).distinct }
|
17
17
|
|
18
18
|
def set_slug
|
19
19
|
# Manually generate slug instead of using friendly id, for testing.
|
@@ -15,14 +15,15 @@
|
|
15
15
|
|
16
16
|
.container
|
17
17
|
= render_hero_unit
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
.row
|
19
|
+
- if user_signed_in?
|
20
|
+
= message_train_widget
|
21
|
+
= render_widgets 'md', 3
|
22
|
+
.col-md-9.content
|
23
|
+
= render_h1 # For the h1 tag containing the title alone
|
24
|
+
#alert_area
|
25
|
+
= alert_flash_messages
|
26
|
+
= yield
|
26
27
|
|
27
28
|
%footer
|
28
29
|
= render_footer_javascript
|
data/spec/dummy/bin/setup
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
require 'pathname'
|
3
3
|
|
4
4
|
# path to your application root.
|
5
|
-
APP_ROOT = Pathname.new File.expand_path('../../',
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
6
|
|
7
7
|
Dir.chdir APP_ROOT do
|
8
8
|
# This script is a starting point to setup your application.
|
9
9
|
# Add necessary setup steps to this file:
|
10
10
|
|
11
|
-
puts
|
12
|
-
system
|
13
|
-
system
|
11
|
+
puts '== Installing dependencies =='
|
12
|
+
system 'gem install bundler --conservative'
|
13
|
+
system 'bundle check || bundle install'
|
14
14
|
|
15
15
|
# puts "\n== Copying sample files =="
|
16
16
|
# unless File.exist?("config/database.yml")
|
@@ -18,12 +18,12 @@ Dir.chdir APP_ROOT do
|
|
18
18
|
# end
|
19
19
|
|
20
20
|
puts "\n== Preparing database =="
|
21
|
-
system
|
21
|
+
system 'bin/rake db:setup'
|
22
22
|
|
23
23
|
puts "\n== Removing old logs and tempfiles =="
|
24
|
-
system
|
25
|
-
system
|
24
|
+
system 'rm -f log/*'
|
25
|
+
system 'rm -rf tmp/cache'
|
26
26
|
|
27
27
|
puts "\n== Restarting application server =="
|
28
|
-
system
|
28
|
+
system 'touch tmp/restart.txt'
|
29
29
|
end
|
@@ -30,9 +30,6 @@ module Dummy
|
|
30
30
|
# ]
|
31
31
|
# config.i18n.default_locale = :de
|
32
32
|
|
33
|
-
# Do not swallow errors in after_commit/after_rollback callbacks.
|
34
|
-
config.active_record.raise_in_transactional_callbacks = true
|
35
|
-
|
36
33
|
config.generators do |g|
|
37
34
|
g.orm :active_record
|
38
35
|
g.template_engine :haml
|
@@ -14,8 +14,10 @@ Rails.application.configure do
|
|
14
14
|
config.eager_load = false
|
15
15
|
|
16
16
|
# Configure static file server for tests with Cache-Control for performance.
|
17
|
-
config.
|
18
|
-
config.
|
17
|
+
config.public_file_server.enabled = true
|
18
|
+
config.public_file_server.headers = {
|
19
|
+
'Cache-Control' => 'public, max-age=3600'
|
20
|
+
}
|
19
21
|
|
20
22
|
# Show full error reports and disable caching.
|
21
23
|
config.consider_all_requests_local = true
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# This file is auto-generated from the current state of the database. Instead
|
3
2
|
# of editing this file, please use the migrations feature of Active Record to
|
4
3
|
# incrementally modify your database, and then regenerate this schema definition.
|
@@ -13,126 +12,118 @@
|
|
13
12
|
|
14
13
|
ActiveRecord::Schema.define(version: 20160207190409) do
|
15
14
|
|
16
|
-
create_table
|
17
|
-
t.string
|
18
|
-
t.string
|
19
|
-
t.text
|
20
|
-
t.datetime
|
21
|
-
t.datetime
|
15
|
+
create_table "groups", force: :cascade do |t|
|
16
|
+
t.string "title"
|
17
|
+
t.string "slug"
|
18
|
+
t.text "description"
|
19
|
+
t.datetime "created_at", null: false
|
20
|
+
t.datetime "updated_at", null: false
|
22
21
|
end
|
23
22
|
|
24
|
-
create_table
|
25
|
-
t.integer
|
26
|
-
t.string
|
27
|
-
t.string
|
28
|
-
t.integer
|
29
|
-
t.datetime
|
30
|
-
t.datetime
|
31
|
-
t.datetime
|
23
|
+
create_table "message_train_attachments", force: :cascade do |t|
|
24
|
+
t.integer "message_train_message_id"
|
25
|
+
t.string "attachment_file_name"
|
26
|
+
t.string "attachment_content_type"
|
27
|
+
t.integer "attachment_file_size"
|
28
|
+
t.datetime "attachment_updated_at"
|
29
|
+
t.datetime "created_at", null: false
|
30
|
+
t.datetime "updated_at", null: false
|
31
|
+
t.index ["message_train_message_id"], name: "index_message_train_attachments_on_message_train_message_id"
|
32
32
|
end
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
t.
|
38
|
-
t.datetime 'created_at', null: false
|
39
|
-
t.datetime 'updated_at', null: false
|
34
|
+
create_table "message_train_conversations", force: :cascade do |t|
|
35
|
+
t.string "subject"
|
36
|
+
t.datetime "created_at", null: false
|
37
|
+
t.datetime "updated_at", null: false
|
40
38
|
end
|
41
39
|
|
42
|
-
create_table
|
43
|
-
t.
|
44
|
-
t.
|
45
|
-
t.integer
|
46
|
-
t.datetime
|
47
|
-
t.datetime
|
40
|
+
create_table "message_train_ignores", force: :cascade do |t|
|
41
|
+
t.string "participant_type"
|
42
|
+
t.integer "participant_id"
|
43
|
+
t.integer "message_train_conversation_id"
|
44
|
+
t.datetime "created_at", null: false
|
45
|
+
t.datetime "updated_at", null: false
|
46
|
+
t.index ["message_train_conversation_id"], name: "index_message_train_ignores_on_message_train_conversation_id"
|
47
|
+
t.index ["participant_type", "participant_id"], name: "participant_index"
|
48
48
|
end
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
t.
|
55
|
-
t.
|
56
|
-
t.
|
57
|
-
t.
|
58
|
-
t.
|
59
|
-
t.
|
60
|
-
t.
|
61
|
-
t.
|
62
|
-
t.datetime 'updated_at', null: false
|
50
|
+
create_table "message_train_messages", force: :cascade do |t|
|
51
|
+
t.integer "message_train_conversation_id"
|
52
|
+
t.string "sender_type"
|
53
|
+
t.integer "sender_id"
|
54
|
+
t.text "recipients_to_save"
|
55
|
+
t.string "subject"
|
56
|
+
t.text "body"
|
57
|
+
t.boolean "draft", default: false
|
58
|
+
t.datetime "created_at", null: false
|
59
|
+
t.datetime "updated_at", null: false
|
60
|
+
t.index ["message_train_conversation_id"], name: "index_message_train_messages_on_message_train_conversation_id"
|
61
|
+
t.index ["sender_type", "sender_id"], name: "index_message_train_messages_on_sender_type_and_sender_id"
|
63
62
|
end
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
t.
|
70
|
-
t.
|
71
|
-
t.
|
72
|
-
t.boolean
|
73
|
-
t.
|
74
|
-
t.
|
75
|
-
t.
|
76
|
-
t.
|
77
|
-
t.
|
78
|
-
t.
|
79
|
-
t.
|
64
|
+
create_table "message_train_receipts", force: :cascade do |t|
|
65
|
+
t.string "recipient_type"
|
66
|
+
t.integer "recipient_id"
|
67
|
+
t.integer "message_train_message_id"
|
68
|
+
t.boolean "marked_read", default: false
|
69
|
+
t.boolean "marked_trash", default: false
|
70
|
+
t.boolean "marked_deleted", default: false
|
71
|
+
t.boolean "sender", default: false
|
72
|
+
t.datetime "created_at", null: false
|
73
|
+
t.datetime "updated_at", null: false
|
74
|
+
t.string "received_through_type"
|
75
|
+
t.integer "received_through_id"
|
76
|
+
t.index ["message_train_message_id", "recipient_type", "recipient_id"], name: "message_recipient", unique: true
|
77
|
+
t.index ["message_train_message_id"], name: "index_message_train_receipts_on_message_train_message_id"
|
78
|
+
t.index ["received_through_type", "received_through_id"], name: "index_message_train_receipts_on_received_through"
|
79
|
+
t.index ["recipient_type", "recipient_id"], name: "index_message_train_receipts_on_recipient"
|
80
80
|
end
|
81
81
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
t.
|
89
|
-
t.
|
90
|
-
t.
|
91
|
-
t.
|
92
|
-
t.datetime 'created_at', null: false
|
93
|
-
t.datetime 'updated_at', null: false
|
82
|
+
create_table "message_train_unsubscribes", force: :cascade do |t|
|
83
|
+
t.string "recipient_type"
|
84
|
+
t.integer "recipient_id"
|
85
|
+
t.string "from_type"
|
86
|
+
t.integer "from_id"
|
87
|
+
t.datetime "created_at", null: false
|
88
|
+
t.datetime "updated_at", null: false
|
89
|
+
t.index ["from_type", "from_id"], name: "unsubscribe_from"
|
90
|
+
t.index ["recipient_type", "recipient_id", "from_type", "from_id"], name: "unsubscribe", unique: true
|
91
|
+
t.index ["recipient_type", "recipient_id"], name: "unsubscribe_recipient"
|
94
92
|
end
|
95
93
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
t.
|
102
|
-
t.
|
103
|
-
t.
|
104
|
-
t.datetime 'created_at'
|
105
|
-
t.datetime 'updated_at'
|
94
|
+
create_table "roles", force: :cascade do |t|
|
95
|
+
t.string "name"
|
96
|
+
t.string "resource_type"
|
97
|
+
t.integer "resource_id"
|
98
|
+
t.datetime "created_at"
|
99
|
+
t.datetime "updated_at"
|
100
|
+
t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
|
101
|
+
t.index ["name"], name: "index_roles_on_name"
|
106
102
|
end
|
107
103
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
t.
|
113
|
-
t.
|
114
|
-
t.
|
115
|
-
t.datetime
|
116
|
-
t.datetime
|
117
|
-
t.
|
118
|
-
t.
|
119
|
-
t.datetime
|
120
|
-
t.
|
121
|
-
t.string
|
122
|
-
t.
|
123
|
-
t.
|
124
|
-
t.
|
125
|
-
t.string 'slug'
|
104
|
+
create_table "users", force: :cascade do |t|
|
105
|
+
t.string "email", default: "", null: false
|
106
|
+
t.string "encrypted_password", default: "", null: false
|
107
|
+
t.string "reset_password_token"
|
108
|
+
t.datetime "reset_password_sent_at"
|
109
|
+
t.datetime "remember_created_at"
|
110
|
+
t.integer "sign_in_count", default: 0, null: false
|
111
|
+
t.datetime "current_sign_in_at"
|
112
|
+
t.datetime "last_sign_in_at"
|
113
|
+
t.string "current_sign_in_ip"
|
114
|
+
t.string "last_sign_in_ip"
|
115
|
+
t.datetime "created_at", null: false
|
116
|
+
t.datetime "updated_at", null: false
|
117
|
+
t.string "display_name"
|
118
|
+
t.string "slug"
|
119
|
+
t.index ["email"], name: "index_users_on_email", unique: true
|
120
|
+
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
126
121
|
end
|
127
122
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
t.integer 'user_id'
|
133
|
-
t.integer 'role_id'
|
123
|
+
create_table "users_roles", id: false, force: :cascade do |t|
|
124
|
+
t.integer "user_id"
|
125
|
+
t.integer "role_id"
|
126
|
+
t.index ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id"
|
134
127
|
end
|
135
128
|
|
136
|
-
add_index 'users_roles', ['user_id', 'role_id'], name: 'index_users_roles_on_user_id_and_role_id'
|
137
|
-
|
138
129
|
end
|