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.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +16 -13
  3. data/.rubocop_todo.yml +12 -0
  4. data/.ruby-version +1 -1
  5. data/.travis.yml +1 -1
  6. data/Gemfile +28 -30
  7. data/README.md +284 -0
  8. data/Rakefile +6 -7
  9. data/VERSION +1 -1
  10. data/app/assets/javascripts/ckeditor/{config.js.coffee → config.js} +7 -6
  11. data/app/assets/stylesheets/message_train.scss +0 -8
  12. data/app/controllers/concerns/message_train_authorization.rb +37 -0
  13. data/app/controllers/concerns/message_train_support.rb +41 -69
  14. data/app/controllers/message_train/application_controller.rb +1 -0
  15. data/app/controllers/message_train/boxes_controller.rb +5 -4
  16. data/app/controllers/message_train/conversations_controller.rb +7 -5
  17. data/app/controllers/message_train/messages_controller.rb +43 -27
  18. data/app/controllers/message_train/participants_controller.rb +14 -25
  19. data/app/controllers/message_train/unsubscribes_controller.rb +96 -61
  20. data/app/helpers/message_train/application_helper.rb +13 -7
  21. data/app/helpers/message_train/attachments_helper.rb +4 -12
  22. data/app/helpers/message_train/boxes_helper.rb +4 -14
  23. data/app/helpers/message_train/collectives_helper.rb +23 -29
  24. data/app/helpers/message_train/conversations_helper.rb +52 -30
  25. data/app/helpers/message_train/messages_helper.rb +33 -20
  26. data/app/mailers/message_train/receipt_mailer.rb +22 -12
  27. data/app/models/message_train/attachment.rb +2 -2
  28. data/app/models/message_train/box.rb +182 -228
  29. data/app/models/message_train/conversation.rb +100 -103
  30. data/app/models/message_train/ignore.rb +83 -4
  31. data/app/models/message_train/message.rb +66 -117
  32. data/app/models/message_train/receipt.rb +73 -49
  33. data/app/views/message_train/boxes/show.html.haml +11 -7
  34. data/config/locales/en.yml +1 -0
  35. data/config/routes.rb +6 -12
  36. data/lib/message_train.rb +3 -1
  37. data/lib/message_train/class_methods.rb +51 -0
  38. data/lib/message_train/configuration.rb +28 -3
  39. data/lib/message_train/instance_methods.rb +209 -0
  40. data/lib/message_train/mixin.rb +25 -320
  41. data/message_train.gemspec +83 -83
  42. data/spec/controllers/message_train/boxes_controller_spec.rb +37 -19
  43. data/spec/controllers/message_train/concerns_spec.rb +21 -3
  44. data/spec/controllers/message_train/conversations_controller_spec.rb +41 -18
  45. data/spec/controllers/message_train/messages_controller_spec.rb +112 -31
  46. data/spec/controllers/message_train/participants_controller_spec.rb +33 -7
  47. data/spec/controllers/message_train/unsubscribes_controller_spec.rb +10 -8
  48. data/spec/dummy/app/assets/stylesheets/{application.css.scss → application.scss} +2 -1
  49. data/spec/dummy/app/assets/stylesheets/bootstrap-everything.scss +54 -0
  50. data/spec/dummy/app/models/group.rb +1 -1
  51. data/spec/dummy/app/views/layouts/application.html.haml +9 -8
  52. data/spec/dummy/bin/setup +8 -8
  53. data/spec/dummy/config/application.rb +0 -3
  54. data/spec/dummy/config/environments/test.rb +4 -2
  55. data/spec/dummy/db/schema.rb +94 -103
  56. data/spec/dummy/db/test.sqlite3 +0 -0
  57. data/spec/factories/attachment.rb +3 -1
  58. data/spec/factories/message.rb +2 -3
  59. data/spec/features/boxes_spec.rb +0 -3
  60. data/spec/helpers/message_train/application_helper_spec.rb +3 -2
  61. data/spec/helpers/message_train/attachment_helper_spec.rb +4 -0
  62. data/spec/helpers/message_train/boxes_helper_spec.rb +1 -0
  63. data/spec/helpers/message_train/collectives_helper_spec.rb +1 -0
  64. data/spec/helpers/message_train/conversations_helper_spec.rb +3 -2
  65. data/spec/helpers/message_train/messages_helper_spec.rb +2 -1
  66. data/spec/models/group_spec.rb +6 -4
  67. data/spec/models/message_train/box_spec.rb +0 -88
  68. data/spec/models/message_train/ignore_spec.rb +65 -0
  69. data/spec/models/message_train/message_spec.rb +6 -5
  70. data/spec/models/message_train/receipt_spec.rb +6 -8
  71. data/spec/models/role_spec.rb +2 -2
  72. data/spec/models/user_spec.rb +29 -101
  73. data/spec/rails_helper.rb +16 -30
  74. data/spec/support/feature_behaviors.rb +2 -1
  75. data/spec/support/shared_connection.rb +5 -0
  76. data/spec/support/utilities.rb +7 -8
  77. metadata +145 -120
  78. data/README.rdoc +0 -175
  79. data/spec/dummy/app/models/.keep +0 -0
  80. 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 :index, box_division: 'in', model: 'users', format: :json
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 :index, box_division: 'in', model: 'groups', format: :json
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 :index, box_division: 'in', model: 'groups', format: :json
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 :index, box_division: 'in', model: '', format: :json
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
- box_division: 'in',
64
- model: 'users',
65
- id: first_user.id,
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
- id: first_user.unsubscribes.where(
74
- from_type: 'Group',
75
- from_id: unsubscribed_group.id
76
- ).first.id
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',
@@ -1,6 +1,7 @@
1
1
  // 'bootstrap-sprockets' must be imported before 'bootstrap' and 'bootstrap/variables'
2
2
  @import 'bootstrap-sprockets';
3
- @import 'bootstrap';
3
+ @import 'bootstrap-everything';
4
+ @import 'bootstrap/theme';
4
5
  @import 'message_train';
5
6
 
6
7
  .navbar-header {
@@ -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).uniq }
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
- - if user_signed_in?
19
- = message_train_widget
20
- = render_widgets 'md', 3
21
- .col-md-9.content
22
- = render_h1 # For the h1 tag containing the title alone
23
- #alert_area
24
- = alert_flash_messages
25
- = yield
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('../../', __FILE__)
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 "== Installing dependencies =="
12
- system "gem install bundler --conservative"
13
- system "bundle check || bundle install"
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 "bin/rake db:setup"
21
+ system 'bin/rake db:setup'
22
22
 
23
23
  puts "\n== Removing old logs and tempfiles =="
24
- system "rm -f log/*"
25
- system "rm -rf tmp/cache"
24
+ system 'rm -f log/*'
25
+ system 'rm -rf tmp/cache'
26
26
 
27
27
  puts "\n== Restarting application server =="
28
- system "touch tmp/restart.txt"
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.serve_static_files = true
18
- config.static_cache_control = 'public, max-age=3600'
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
@@ -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 'groups', force: :cascade do |t|
17
- t.string 'title'
18
- t.string 'slug'
19
- t.text 'description'
20
- t.datetime 'created_at', null: false
21
- t.datetime 'updated_at', null: false
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 'message_train_attachments', force: :cascade do |t|
25
- t.integer 'message_train_message_id'
26
- t.string 'attachment_file_name'
27
- t.string 'attachment_content_type'
28
- t.integer 'attachment_file_size'
29
- t.datetime 'attachment_updated_at'
30
- t.datetime 'created_at', null: false
31
- t.datetime 'updated_at', null: false
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
- add_index 'message_train_attachments', ['message_train_message_id'], name: 'index_message_train_attachments_on_message_train_message_id'
35
-
36
- create_table 'message_train_conversations', force: :cascade do |t|
37
- t.string 'subject'
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 'message_train_ignores', force: :cascade do |t|
43
- t.integer 'participant_id'
44
- t.string 'participant_type'
45
- t.integer 'message_train_conversation_id'
46
- t.datetime 'created_at', null: false
47
- t.datetime 'updated_at', null: false
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
- add_index 'message_train_ignores', ['message_train_conversation_id'], name: 'index_message_train_ignores_on_message_train_conversation_id'
51
- add_index 'message_train_ignores', ['participant_type', 'participant_id'], name: 'participant_index'
52
-
53
- create_table 'message_train_messages', force: :cascade do |t|
54
- t.integer 'message_train_conversation_id'
55
- t.integer 'sender_id'
56
- t.string 'sender_type'
57
- t.text 'recipients_to_save'
58
- t.string 'subject'
59
- t.text 'body'
60
- t.boolean 'draft', default: false
61
- t.datetime 'created_at', null: false
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
- add_index 'message_train_messages', ['message_train_conversation_id'], name: 'index_message_train_messages_on_message_train_conversation_id'
66
- add_index 'message_train_messages', ['sender_type', 'sender_id'], name: 'index_message_train_messages_on_sender_type_and_sender_id'
67
-
68
- create_table 'message_train_receipts', force: :cascade do |t|
69
- t.integer 'recipient_id'
70
- t.string 'recipient_type'
71
- t.integer 'message_train_message_id'
72
- t.boolean 'marked_read', default: false
73
- t.boolean 'marked_trash', default: false
74
- t.boolean 'marked_deleted', default: false
75
- t.boolean 'sender', default: false
76
- t.datetime 'created_at', null: false
77
- t.datetime 'updated_at', null: false
78
- t.integer 'received_through_id'
79
- t.string 'received_through_type'
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
- add_index 'message_train_receipts', ['message_train_message_id', 'recipient_type', 'recipient_id'], name: 'message_recipient', unique: true
83
- add_index 'message_train_receipts', ['message_train_message_id'], name: 'index_message_train_receipts_on_message_train_message_id'
84
- add_index 'message_train_receipts', ['received_through_type', 'received_through_id'], name: 'index_message_train_receipts_on_received_through'
85
- add_index 'message_train_receipts', ['recipient_type', 'recipient_id'], name: 'index_message_train_receipts_on_recipient'
86
-
87
- create_table 'message_train_unsubscribes', force: :cascade do |t|
88
- t.integer 'recipient_id'
89
- t.string 'recipient_type'
90
- t.integer 'from_id'
91
- t.string 'from_type'
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
- add_index 'message_train_unsubscribes', ['from_type', 'from_id'], name: 'unsubscribe_from'
97
- add_index 'message_train_unsubscribes', ['recipient_type', 'recipient_id', 'from_type', 'from_id'], name: 'unsubscribe', unique: true
98
- add_index 'message_train_unsubscribes', ['recipient_type', 'recipient_id'], name: 'unsubscribe_recipient'
99
-
100
- create_table 'roles', force: :cascade do |t|
101
- t.string 'name'
102
- t.integer 'resource_id'
103
- t.string 'resource_type'
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
- add_index 'roles', ['name', 'resource_type', 'resource_id'], name: 'index_roles_on_name_and_resource_type_and_resource_id'
109
- add_index 'roles', ['name'], name: 'index_roles_on_name'
110
-
111
- create_table 'users', force: :cascade do |t|
112
- t.string 'email', default: "", null: false
113
- t.string 'encrypted_password', default: "", null: false
114
- t.string 'reset_password_token'
115
- t.datetime 'reset_password_sent_at'
116
- t.datetime 'remember_created_at'
117
- t.integer 'sign_in_count', default: 0, null: false
118
- t.datetime 'current_sign_in_at'
119
- t.datetime 'last_sign_in_at'
120
- t.string 'current_sign_in_ip'
121
- t.string 'last_sign_in_ip'
122
- t.datetime 'created_at', null: false
123
- t.datetime 'updated_at', null: false
124
- t.string 'display_name'
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
- add_index 'users', ['email'], name: 'index_users_on_email', unique: true
129
- add_index 'users', ['reset_password_token'], name: 'index_users_on_reset_password_token', unique: true
130
-
131
- create_table 'users_roles', id: false, force: :cascade do |t|
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