message_train 0.7.6 → 1.0.0

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.
Files changed (171) hide show
  1. checksums.yaml +5 -5
  2. data/.gitattributes +1 -0
  3. data/.github/workflows/ci.yml +86 -0
  4. data/.gitignore +64 -0
  5. data/.rubocop.yml +9 -0
  6. data/.rubocop_todo.yml +854 -2
  7. data/.ruby-version +1 -1
  8. data/.simplecov +2 -4
  9. data/CHANGELOG.md +128 -0
  10. data/CLAUDE.md +5 -0
  11. data/Gemfile +29 -31
  12. data/LICENSE.txt +1 -1
  13. data/README.md +106 -35
  14. data/Rakefile +4 -18
  15. data/app/assets/stylesheets/message_train.scss +405 -67
  16. data/app/controllers/concerns/message_train_support.rb +2 -2
  17. data/app/controllers/message_train/boxes_controller.rb +4 -2
  18. data/app/controllers/message_train/conversations_controller.rb +1 -0
  19. data/app/helpers/message_train/application_helper.rb +68 -0
  20. data/app/helpers/message_train/attachments_helper.rb +7 -4
  21. data/app/helpers/message_train/conversations_helper.rb +16 -16
  22. data/app/helpers/message_train/messages_helper.rb +23 -10
  23. data/app/javascript/controllers/message_train/bulk_actions_controller.js +36 -0
  24. data/app/javascript/controllers/message_train/lightbox_controller.js +25 -0
  25. data/app/javascript/controllers/message_train/nested_form_controller.js +36 -0
  26. data/app/javascript/controllers/message_train/recipient_autocomplete_controller.js +31 -0
  27. data/app/mailers/message_train/previews/receipt_mailer_preview.rb +7 -5
  28. data/app/models/message_train/attachment.rb +54 -42
  29. data/app/models/message_train/box.rb +2 -2
  30. data/app/models/message_train/conversation.rb +28 -2
  31. data/app/models/message_train/ignore.rb +2 -2
  32. data/app/models/message_train/message.rb +10 -4
  33. data/app/models/message_train/receipt.rb +27 -4
  34. data/app/models/message_train/unsubscribe.rb +1 -1
  35. data/app/views/application/404.html.haml +1 -3
  36. data/app/views/kaminari/_first_page.html.haml +1 -1
  37. data/app/views/kaminari/_last_page.html.haml +1 -1
  38. data/app/views/kaminari/_next_page.html.haml +1 -1
  39. data/app/views/kaminari/_page.html.haml +3 -3
  40. data/app/views/kaminari/_paginator.html.haml +12 -11
  41. data/app/views/kaminari/_prev_page.html.haml +1 -1
  42. data/app/views/message_train/application/_attachment_fields.html.haml +10 -7
  43. data/app/views/message_train/application/_attachment_link.html.haml +2 -2
  44. data/app/views/message_train/application/_widget.html.haml +2 -4
  45. data/app/views/message_train/boxes/_widget.html.haml +5 -5
  46. data/app/views/message_train/boxes/show.html.haml +28 -45
  47. data/app/views/message_train/collectives/_widget.html.haml +4 -4
  48. data/app/views/message_train/conversations/_conversation.html.haml +11 -11
  49. data/app/views/message_train/conversations/_deleted_toggle.html.haml +1 -1
  50. data/app/views/message_train/conversations/_ignored_toggle.html.haml +2 -2
  51. data/app/views/message_train/conversations/_read_toggle.html.haml +2 -2
  52. data/app/views/message_train/conversations/_toggle.html.haml +6 -4
  53. data/app/views/message_train/conversations/_trashed_toggle.html.haml +2 -2
  54. data/app/views/message_train/conversations/show.html.haml +8 -6
  55. data/app/views/message_train/messages/_deleted_toggle.html.haml +1 -1
  56. data/app/views/message_train/messages/_form.html.haml +22 -30
  57. data/app/views/message_train/messages/_message.html.haml +27 -45
  58. data/app/views/message_train/messages/_read_toggle.html.haml +2 -2
  59. data/app/views/message_train/messages/_toggle.html.haml +5 -1
  60. data/app/views/message_train/messages/_trashed_toggle.html.haml +2 -2
  61. data/app/views/message_train/unsubscribes/index.html.haml +12 -15
  62. data/badges/coverage.json +1 -0
  63. data/config/importmap.rb +2 -0
  64. data/config/locales/en.yml +6 -3
  65. data/db/migrate/20150721145319_create_message_train_conversations.rb +1 -1
  66. data/db/migrate/20150721160322_create_message_train_messages.rb +1 -1
  67. data/db/migrate/20150721161144_create_message_train_attachments.rb +5 -2
  68. data/db/migrate/20150721161940_create_message_train_receipts.rb +1 -1
  69. data/db/migrate/20150721163838_create_message_train_ignores.rb +1 -1
  70. data/db/migrate/20150901183458_add_received_through_to_message_train_receipts.rb +1 -1
  71. data/db/migrate/20151004184347_add_unique_index_to_receipts.rb +1 -1
  72. data/db/migrate/20151124000820_create_message_train_unsubscribes.rb +1 -1
  73. data/db/migrate/20260827095938_remove_paperclip_columns_from_message_train_attachments.rb +8 -0
  74. data/db/migrate/20260827171549_remove_body_from_message_train_messages.rb +5 -0
  75. data/db/migrate/20260827180000_add_marking_indexes.rb +9 -0
  76. data/db/migrate/20260827200000_add_body_back_to_message_train_messages.rb +5 -0
  77. data/docs/screenshots/inbox-desktop.png +0 -0
  78. data/docs/screenshots/inbox-mobile.png +0 -0
  79. data/lib/generators/message_train/install/install_generator.rb +1 -1
  80. data/lib/message_train/engine.rb +11 -0
  81. data/lib/message_train/instance_methods.rb +13 -7
  82. data/lib/message_train/localization.rb +4 -3
  83. data/lib/message_train/version.rb +1 -1
  84. data/lib/message_train.rb +0 -2
  85. data/message_train.gemspec +57 -389
  86. data/spec/controllers/message_train/boxes_controller_spec.rb +13 -8
  87. data/spec/controllers/message_train/concerns_spec.rb +2 -2
  88. data/spec/controllers/message_train/conversations_controller_spec.rb +36 -7
  89. data/spec/controllers/message_train/messages_controller_spec.rb +4 -4
  90. data/spec/dummy/app/assets/stylesheets/application.scss +141 -12
  91. data/spec/dummy/app/controllers/application_controller.rb +1 -1
  92. data/spec/dummy/app/javascript/application.js +4 -0
  93. data/spec/dummy/app/javascript/controllers/application.js +9 -0
  94. data/spec/dummy/app/javascript/controllers/index.js +4 -0
  95. data/spec/dummy/app/models/role.rb +1 -1
  96. data/spec/dummy/app/views/active_storage/blobs/_blob.html.erb +14 -0
  97. data/spec/dummy/app/views/layouts/_top_navigation.html.haml +18 -7
  98. data/spec/dummy/app/views/layouts/application.html.haml +22 -26
  99. data/spec/dummy/bin/importmap +4 -0
  100. data/spec/dummy/config/application.rb +7 -20
  101. data/spec/dummy/config/environments/development.rb +17 -21
  102. data/spec/dummy/config/environments/production.rb +11 -63
  103. data/spec/dummy/config/environments/test.rb +21 -16
  104. data/spec/dummy/config/importmap.rb +7 -0
  105. data/spec/dummy/config/initializers/assets.rb +1 -6
  106. data/spec/dummy/config/routes.rb +1 -1
  107. data/spec/dummy/config/storage.yml +7 -0
  108. data/spec/dummy/db/migrate/20150721140013_devise_create_users.rb +1 -1
  109. data/spec/dummy/db/migrate/20150721141009_rolify_create_roles.rb +1 -1
  110. data/spec/dummy/db/migrate/20150721141128_create_groups.rb +1 -1
  111. data/spec/dummy/db/migrate/20150721150307_add_display_name_column_to_users.rb +1 -1
  112. data/spec/dummy/db/migrate/20160207190402_create_message_train_conversations.message_train.rb +1 -1
  113. data/spec/dummy/db/migrate/20160207190403_create_message_train_messages.message_train.rb +1 -1
  114. data/spec/dummy/db/migrate/20160207190404_create_message_train_attachments.message_train.rb +5 -2
  115. data/spec/dummy/db/migrate/20160207190405_create_message_train_receipts.message_train.rb +1 -1
  116. data/spec/dummy/db/migrate/20160207190406_create_message_train_ignores.message_train.rb +1 -1
  117. data/spec/dummy/db/migrate/20160207190407_add_received_through_to_message_train_receipts.message_train.rb +1 -1
  118. data/spec/dummy/db/migrate/20160207190408_add_unique_index_to_receipts.message_train.rb +1 -1
  119. data/spec/dummy/db/migrate/20160207190409_create_message_train_unsubscribes.message_train.rb +1 -1
  120. data/spec/dummy/db/migrate/20260827095939_remove_paperclip_columns_from_message_train_attachments.message_train.rb +9 -0
  121. data/spec/dummy/db/migrate/20260827161141_create_active_storage_tables.active_storage.rb +57 -0
  122. data/spec/dummy/db/migrate/20260827171550_remove_body_from_message_train_messages.message_train.rb +6 -0
  123. data/spec/dummy/db/migrate/20260827225116_add_marking_indexes.message_train.rb +10 -0
  124. data/spec/dummy/db/migrate/20260828034830_add_body_back_to_message_train_messages.message_train.rb +6 -0
  125. data/spec/dummy/db/migrate/20260828040000_drop_action_text_tables.rb +5 -0
  126. data/spec/dummy/db/schema.rb +106 -72
  127. data/spec/dummy/db/seeds/conversations.seeds.rb +22 -22
  128. data/spec/dummy/db/seeds/development/conversations.seeds.rb +2 -2
  129. data/spec/dummy/db/seeds/groups.seeds.rb +4 -4
  130. data/spec/dummy/db/seeds/test/attachments.seeds.rb +4 -4
  131. data/spec/dummy/db/seeds/test/conversations.seeds.rb +2 -2
  132. data/spec/dummy/db/seeds/users.seeds.rb +8 -8
  133. data/spec/dummy/vendor/javascript/.keep +0 -0
  134. data/spec/factories/attachment.rb +5 -6
  135. data/spec/factories/group.rb +2 -2
  136. data/spec/factories/message.rb +7 -7
  137. data/spec/factories/user.rb +3 -3
  138. data/spec/features/boxes_spec.rb +38 -34
  139. data/spec/features/conversations_spec.rb +13 -6
  140. data/spec/features/messages_spec.rb +20 -20
  141. data/spec/features/unsubscribes_spec.rb +9 -9
  142. data/spec/helpers/message_train/application_helper_spec.rb +16 -18
  143. data/spec/helpers/message_train/attachment_helper_spec.rb +8 -18
  144. data/spec/helpers/message_train/boxes_helper_spec.rb +6 -6
  145. data/spec/helpers/message_train/collectives_helper_spec.rb +10 -10
  146. data/spec/helpers/message_train/conversations_helper_spec.rb +43 -85
  147. data/spec/helpers/message_train/messages_helper_spec.rb +41 -61
  148. data/spec/models/message_train/attachment_spec.rb +26 -36
  149. data/spec/models/message_train/box_spec.rb +2 -2
  150. data/spec/models/message_train/conversation_spec.rb +15 -0
  151. data/spec/models/message_train/message_spec.rb +5 -1
  152. data/spec/models/message_train/receipt_spec.rb +1 -1
  153. data/spec/models/message_train/unsubscribe_spec.rb +1 -1
  154. data/spec/rails_helper.rb +14 -13
  155. data/spec/support/controller_behaviors.rb +13 -13
  156. data/spec/support/factory_bot.rb +3 -0
  157. data/spec/support/feature_behaviors.rb +14 -14
  158. data/spec/support/loaded_site/attachments.rb +6 -2
  159. data/spec/support/utilities.rb +49 -20
  160. metadata +260 -213
  161. data/.travis.yml +0 -12
  162. data/VERSION +0 -1
  163. data/app/assets/javascripts/ckeditor/config.js +0 -49
  164. data/app/assets/javascripts/message_train.js +0 -149
  165. data/spec/dummy/app/assets/javascripts/application.js +0 -17
  166. data/spec/dummy/app/assets/stylesheets/bootstrap-everything.scss +0 -54
  167. data/spec/dummy/config/initializers/bootstrap_leather.rb +0 -7
  168. data/spec/dummy/config/initializers/paperclip.rb +0 -5
  169. data/spec/dummy/config/secrets.yml +0 -22
  170. data/spec/dummy/db/test.sqlite3 +0 -0
  171. data/spec/support/factory_girl.rb +0 -3
@@ -3,81 +3,29 @@ Rails.application.configure do
3
3
  # config/application.rb.
4
4
 
5
5
  # Code is not reloaded between requests.
6
- config.cache_classes = true
6
+ config.enable_reloading = false
7
7
 
8
- # Eager load code on boot. This eager loads most of Rails and
9
- # your application in memory, allowing both threaded web servers
10
- # and those relying on copy on write to perform better.
11
- # Rake tasks automatically ignore this option for performance.
8
+ # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
12
9
  config.eager_load = true
13
10
 
14
- # Full error reports are disabled and caching is turned on.
15
- config.consider_all_requests_local = false
16
- config.action_controller.perform_caching = true
17
-
18
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
19
- # Add `rack-cache` to your Gemfile before enabling this.
20
- # For large-scale production use, consider using a caching reverse proxy like
21
- # NGINX, varnish or squid.
22
- # config.action_dispatch.rack_cache = true
23
-
24
- # Disable serving static files from the `/public` folder by default since
25
- # Apache or NGINX already handles this.
26
- config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
27
-
28
- # Compress JavaScripts and CSS.
29
- config.assets.js_compressor = :uglifier
30
- # config.assets.css_compressor = :sass
31
-
32
- # Do not fallback to assets pipeline if a precompiled asset is missed.
33
- config.assets.compile = false
34
-
35
- # Asset digests allow you to set far-future HTTP expiration dates on all
36
- # assets, yet still be able to expire them through the digest params.
37
- config.assets.digest = true
38
-
39
- # `config.assets.precompile` and `config.assets.version` have moved to
40
- # config/initializers/assets.rb
41
-
42
- # Specifies the header that your server uses for sending files.
43
- # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
44
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
11
+ # Full error reports are disabled.
12
+ config.consider_all_requests_local = false
45
13
 
46
- # Force all access to the app over SSL, use Strict-Transport-Security,
47
- # and use secure cookies.
48
- # config.force_ssl = true
49
-
50
- # Use the lowest log level to ensure availability of diagnostic information
51
- # when problems arise.
52
- config.log_level = :debug
53
-
54
- # Prepend all log lines with the following tags.
55
- # config.log_tags = [ :subdomain, :uuid ]
56
-
57
- # Use a different logger for distributed setups.
58
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
59
-
60
- # Use a different cache store in production.
61
- # config.cache_store = :mem_cache_store
62
-
63
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
64
- # config.action_controller.asset_host = 'http://assets.example.com'
14
+ # Turn on fragment caching in view templates.
15
+ config.action_controller.perform_caching = true
65
16
 
66
- # Ignore bad email addresses and do not raise email delivery errors.
67
- # Set this to true and configure the email server for immediate delivery to
68
- # raise delivery errors.
69
- # config.action_mailer.raise_delivery_errors = false
17
+ # Store uploaded files on the local file system (see config/storage.yml for options).
18
+ config.active_storage.service = :local
70
19
 
71
20
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
72
21
  # the I18n.default_locale when a translation cannot be found).
73
22
  config.i18n.fallbacks = true
74
23
 
75
24
  # Send deprecation notices to registered listeners.
76
- config.active_support.deprecation = :notify
77
-
78
- # Use default logging formatter so that PID and timestamp are not suppressed.
79
- config.log_formatter = ::Logger::Formatter.new
25
+ config.active_support.report_deprecations = false
80
26
 
81
27
  # Do not dump schema after migrations.
82
28
  config.active_record.dump_schema_after_migration = false
29
+
30
+ config.secret_key_base = ENV['SECRET_KEY_BASE']
83
31
  end
@@ -6,29 +6,30 @@ Rails.application.configure do
6
6
  # test suite. You never need to work with it otherwise. Remember that
7
7
  # your test database is 'scratch space' for the test suite and is wiped
8
8
  # and recreated between test runs. Don't rely on the data there!
9
- config.cache_classes = true
9
+ config.enable_reloading = false
10
10
 
11
- # Do not eager load code on boot. This avoids loading your whole application
12
- # just for the purpose of running a single test. If you are using a tool that
13
- # preloads Rails for running tests, you may have to set it to true.
14
- config.eager_load = false
11
+ # Eager loading loads your entire application. When running a single test locally,
12
+ # this is usually not necessary, and can slow down your test suite. However, it's
13
+ # recommended that you enable it in continuous integration systems to ensure eager
14
+ # loading is working properly before deploying your code.
15
+ config.eager_load = ENV['CI'].present?
15
16
 
16
- # Configure static file server for tests with Cache-Control for performance.
17
- config.public_file_server.enabled = true
18
- config.public_file_server.headers = {
19
- 'Cache-Control' => 'public, max-age=3600'
20
- }
17
+ # Configure public file server for tests with cache-control for performance.
18
+ config.public_file_server.headers = { 'cache-control' => 'public, max-age=3600' }
21
19
 
22
- # Show full error reports and disable caching.
23
- config.consider_all_requests_local = true
24
- config.action_controller.perform_caching = false
20
+ # Show full error reports.
21
+ config.consider_all_requests_local = true
22
+ config.cache_store = :null_store
25
23
 
26
- # Raise exceptions instead of rendering exception templates.
27
- config.action_dispatch.show_exceptions = false
24
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
25
+ config.action_dispatch.show_exceptions = :rescuable
28
26
 
29
27
  # Disable request forgery protection in test environment.
30
28
  config.action_controller.allow_forgery_protection = false
31
29
 
30
+ # Store uploaded files on the local file system in a temporary directory.
31
+ config.active_storage.service = :test
32
+
32
33
  # Tell Action Mailer not to deliver emails to the real world.
33
34
  # The :test delivery method accumulates sent emails in the
34
35
  # ActionMailer::Base.deliveries array.
@@ -42,5 +43,9 @@ Rails.application.configure do
42
43
  config.active_support.deprecation = :stderr
43
44
 
44
45
  # Raises error for missing translations
45
- # config.action_view.raise_on_missing_translations = true
46
+ # config.i18n.raise_on_missing_translations = true
47
+
48
+ config.secret_key_base = '8b9c1409e1f4fbe98767d7df8e83d024eb7a2965217977a6' \
49
+ '8bdfc7e4fd0940bab4bd61f658032fc7cfc9c0ec68d0d9e' \
50
+ 'bdf99c2f1ab385f8f9306cb15330f1ab8'
46
51
  end
@@ -0,0 +1,7 @@
1
+ # Pin npm packages by running ./bin/importmap
2
+
3
+ pin "application"
4
+ pin "@hotwired/stimulus", to: "stimulus.min.js"
5
+ pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
6
+ pin_all_from "app/javascript/controllers", under: "controllers"
7
+ pin "@hotwired/turbo-rails", to: "turbo.min.js"
@@ -3,10 +3,5 @@
3
3
  # Version of your assets, change this if you want to expire all your assets.
4
4
  Rails.application.config.assets.version = '1.0'
5
5
 
6
- # Add additional assets to the asset load path
6
+ # Add additional assets to the asset load path.
7
7
  # Rails.application.config.assets.paths << Emoji.images_path
8
-
9
- # Precompile additional assets.
10
- # application.js, application.css, and all non-JS/CSS in app/assets folder
11
- # are already added.
12
- # Rails.application.config.assets.precompile += %w( search.js )
@@ -1,4 +1,4 @@
1
1
  Rails.application.routes.draw do
2
- mount MessageTrain::Engine => '/', as: 'message_train'
2
+ mount MessageTrain::Engine => '/messages', as: 'message_train'
3
3
  devise_for :users
4
4
  end
@@ -0,0 +1,7 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join('tmp/storage') %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join('storage') %>
@@ -1,4 +1,4 @@
1
- class DeviseCreateUsers < ActiveRecord::Migration
1
+ class DeviseCreateUsers < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table(:users) do |t|
4
4
  ## Database authenticatable
@@ -1,4 +1,4 @@
1
- class RolifyCreateRoles < ActiveRecord::Migration
1
+ class RolifyCreateRoles < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table(:roles) do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateGroups < ActiveRecord::Migration
1
+ class CreateGroups < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :groups do |t|
4
4
  t.string :title
@@ -1,4 +1,4 @@
1
- class AddDisplayNameColumnToUsers < ActiveRecord::Migration
1
+ class AddDisplayNameColumnToUsers < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :users, :display_name, :string
4
4
  add_column :users, :slug, :string, unique: true
@@ -1,5 +1,5 @@
1
1
  # This migration comes from message_train (originally 20150721145319)
2
- class CreateMessageTrainConversations < ActiveRecord::Migration
2
+ class CreateMessageTrainConversations < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :message_train_conversations do |t|
5
5
  t.string :subject
@@ -1,5 +1,5 @@
1
1
  # This migration comes from message_train (originally 20150721160322)
2
- class CreateMessageTrainMessages < ActiveRecord::Migration
2
+ class CreateMessageTrainMessages < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :message_train_messages do |t|
5
5
  t.references :message_train_conversation, index: true, foreign_key: true
@@ -1,9 +1,12 @@
1
1
  # This migration comes from message_train (originally 20150721161144)
2
- class CreateMessageTrainAttachments < ActiveRecord::Migration
2
+ class CreateMessageTrainAttachments < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :message_train_attachments do |t|
5
5
  t.references :message_train_message, index: true, foreign_key: true
6
- t.attachment :attachment
6
+ t.string :attachment_file_name
7
+ t.string :attachment_content_type
8
+ t.integer :attachment_file_size
9
+ t.datetime :attachment_updated_at
7
10
 
8
11
  t.timestamps null: false
9
12
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from message_train (originally 20150721161940)
2
- class CreateMessageTrainReceipts < ActiveRecord::Migration
2
+ class CreateMessageTrainReceipts < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :message_train_receipts do |t|
5
5
  t.references :recipient, polymorphic: true
@@ -1,5 +1,5 @@
1
1
  # This migration comes from message_train (originally 20150721163838)
2
- class CreateMessageTrainIgnores < ActiveRecord::Migration
2
+ class CreateMessageTrainIgnores < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :message_train_ignores do |t|
5
5
  t.references :participant, polymorphic: true
@@ -1,5 +1,5 @@
1
1
  # This migration comes from message_train (originally 20150901183458)
2
- class AddReceivedThroughToMessageTrainReceipts < ActiveRecord::Migration
2
+ class AddReceivedThroughToMessageTrainReceipts < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_reference :message_train_receipts, :received_through, polymorphic: true
5
5
  add_index :message_train_receipts, [:received_through_type, :received_through_id], name: :index_message_train_receipts_on_received_through
@@ -1,5 +1,5 @@
1
1
  # This migration comes from message_train (originally 20151004184347)
2
- class AddUniqueIndexToReceipts < ActiveRecord::Migration
2
+ class AddUniqueIndexToReceipts < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  add_index :message_train_receipts, [:message_train_message_id, :recipient_type, :recipient_id], name: :message_recipient, unique: true
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # This migration comes from message_train (originally 20151124000820)
2
- class CreateMessageTrainUnsubscribes < ActiveRecord::Migration
2
+ class CreateMessageTrainUnsubscribes < ActiveRecord::Migration[4.2]
3
3
  def change
4
4
  create_table :message_train_unsubscribes do |t|
5
5
  t.references :recipient, polymorphic: true
@@ -0,0 +1,9 @@
1
+ # This migration comes from message_train (originally 20260827095938)
2
+ class RemovePaperclipColumnsFromMessageTrainAttachments < ActiveRecord::Migration[7.1]
3
+ def change
4
+ remove_column :message_train_attachments, :attachment_file_name, :string
5
+ remove_column :message_train_attachments, :attachment_content_type, :string
6
+ remove_column :message_train_attachments, :attachment_file_size, :integer
7
+ remove_column :message_train_attachments, :attachment_updated_at, :datetime
8
+ end
9
+ end
@@ -0,0 +1,57 @@
1
+ # This migration comes from active_storage (originally 20170806125915)
2
+ class CreateActiveStorageTables < ActiveRecord::Migration[7.0]
3
+ def change
4
+ # Use Active Record's configured type for primary and foreign keys
5
+ primary_key_type, foreign_key_type = primary_and_foreign_key_types
6
+
7
+ create_table :active_storage_blobs, id: primary_key_type do |t|
8
+ t.string :key, null: false
9
+ t.string :filename, null: false
10
+ t.string :content_type
11
+ t.text :metadata
12
+ t.string :service_name, null: false
13
+ t.bigint :byte_size, null: false
14
+ t.string :checksum
15
+
16
+ if connection.supports_datetime_with_precision?
17
+ t.datetime :created_at, precision: 6, null: false
18
+ else
19
+ t.datetime :created_at, null: false
20
+ end
21
+
22
+ t.index [ :key ], unique: true
23
+ end
24
+
25
+ create_table :active_storage_attachments, id: primary_key_type do |t|
26
+ t.string :name, null: false
27
+ t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
28
+ t.references :blob, null: false, type: foreign_key_type
29
+
30
+ if connection.supports_datetime_with_precision?
31
+ t.datetime :created_at, precision: 6, null: false
32
+ else
33
+ t.datetime :created_at, null: false
34
+ end
35
+
36
+ t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true
37
+ t.foreign_key :active_storage_blobs, column: :blob_id
38
+ end
39
+
40
+ create_table :active_storage_variant_records, id: primary_key_type do |t|
41
+ t.belongs_to :blob, null: false, index: false, type: foreign_key_type
42
+ t.string :variation_digest, null: false
43
+
44
+ t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true
45
+ t.foreign_key :active_storage_blobs, column: :blob_id
46
+ end
47
+ end
48
+
49
+ private
50
+ def primary_and_foreign_key_types
51
+ config = Rails.configuration.generators
52
+ setting = config.options[config.orm][:primary_key_type]
53
+ primary_key_type = setting || :primary_key
54
+ foreign_key_type = setting || :bigint
55
+ [ primary_key_type, foreign_key_type ]
56
+ end
57
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from message_train (originally 20260827171549)
2
+ class RemoveBodyFromMessageTrainMessages < ActiveRecord::Migration[7.1]
3
+ def change
4
+ remove_column :message_train_messages, :body, :text
5
+ end
6
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from message_train (originally 20260827180000)
2
+ class AddMarkingIndexes < ActiveRecord::Migration[7.1]
3
+ def change
4
+ add_index :message_train_receipts, :marked_read
5
+ add_index :message_train_receipts, :marked_trash
6
+ add_index :message_train_receipts, :marked_deleted
7
+ add_index :message_train_conversations, :updated_at
8
+ add_index :message_train_messages, :draft
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from message_train (originally 20260827200000)
2
+ class AddBodyBackToMessageTrainMessages < ActiveRecord::Migration[7.1]
3
+ def change
4
+ add_column :message_train_messages, :body, :text
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class DropActionTextTables < ActiveRecord::Migration[7.1]
2
+ def change
3
+ drop_table :action_text_rich_texts, if_exists: true
4
+ end
5
+ end
@@ -2,77 +2,105 @@
2
2
  # of editing this file, please use the migrations feature of Active Record to
3
3
  # incrementally modify your database, and then regenerate this schema definition.
4
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).
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20160207190409) do
13
+ ActiveRecord::Schema[8.1].define(version: 2026_08_28_040000) do
14
+ create_table "active_storage_attachments", force: :cascade do |t|
15
+ t.bigint "blob_id", null: false
16
+ t.datetime "created_at", null: false
17
+ t.string "name", null: false
18
+ t.bigint "record_id", null: false
19
+ t.string "record_type", null: false
20
+ t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
21
+ t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
22
+ end
23
+
24
+ create_table "active_storage_blobs", force: :cascade do |t|
25
+ t.bigint "byte_size", null: false
26
+ t.string "checksum"
27
+ t.string "content_type"
28
+ t.datetime "created_at", null: false
29
+ t.string "filename", null: false
30
+ t.string "key", null: false
31
+ t.text "metadata"
32
+ t.string "service_name", null: false
33
+ t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
34
+ end
35
+
36
+ create_table "active_storage_variant_records", force: :cascade do |t|
37
+ t.bigint "blob_id", null: false
38
+ t.string "variation_digest", null: false
39
+ t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
40
+ end
14
41
 
15
42
  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
43
+ t.datetime "created_at", precision: nil, null: false
44
+ t.text "description"
45
+ t.string "slug"
46
+ t.string "title"
47
+ t.datetime "updated_at", precision: nil, null: false
21
48
  end
22
49
 
23
50
  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
51
+ t.datetime "created_at", precision: nil, null: false
52
+ t.integer "message_train_message_id"
53
+ t.datetime "updated_at", precision: nil, null: false
31
54
  t.index ["message_train_message_id"], name: "index_message_train_attachments_on_message_train_message_id"
32
55
  end
33
56
 
34
57
  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
58
+ t.datetime "created_at", precision: nil, null: false
59
+ t.string "subject"
60
+ t.datetime "updated_at", precision: nil, null: false
61
+ t.index ["updated_at"], name: "index_message_train_conversations_on_updated_at"
38
62
  end
39
63
 
40
64
  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
65
+ t.datetime "created_at", precision: nil, null: false
66
+ t.integer "message_train_conversation_id"
67
+ t.integer "participant_id"
68
+ t.string "participant_type"
69
+ t.datetime "updated_at", precision: nil, null: false
46
70
  t.index ["message_train_conversation_id"], name: "index_message_train_ignores_on_message_train_conversation_id"
47
71
  t.index ["participant_type", "participant_id"], name: "participant_index"
48
72
  end
49
73
 
50
74
  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
75
+ t.text "body"
76
+ t.datetime "created_at", precision: nil, null: false
77
+ t.boolean "draft", default: false
78
+ t.integer "message_train_conversation_id"
79
+ t.text "recipients_to_save"
80
+ t.integer "sender_id"
81
+ t.string "sender_type"
82
+ t.string "subject"
83
+ t.datetime "updated_at", precision: nil, null: false
84
+ t.index ["draft"], name: "index_message_train_messages_on_draft"
60
85
  t.index ["message_train_conversation_id"], name: "index_message_train_messages_on_message_train_conversation_id"
61
86
  t.index ["sender_type", "sender_id"], name: "index_message_train_messages_on_sender_type_and_sender_id"
62
87
  end
63
88
 
64
89
  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"
90
+ t.datetime "created_at", precision: nil, null: false
91
+ t.boolean "marked_deleted", default: false
92
+ t.boolean "marked_read", default: false
93
+ t.boolean "marked_trash", default: false
94
+ t.integer "message_train_message_id"
95
+ t.integer "received_through_id"
96
+ t.string "received_through_type"
97
+ t.integer "recipient_id"
98
+ t.string "recipient_type"
99
+ t.boolean "sender", default: false
100
+ t.datetime "updated_at", precision: nil, null: false
101
+ t.index ["marked_deleted"], name: "index_message_train_receipts_on_marked_deleted"
102
+ t.index ["marked_read"], name: "index_message_train_receipts_on_marked_read"
103
+ t.index ["marked_trash"], name: "index_message_train_receipts_on_marked_trash"
76
104
  t.index ["message_train_message_id", "recipient_type", "recipient_id"], name: "message_recipient", unique: true
77
105
  t.index ["message_train_message_id"], name: "index_message_train_receipts_on_message_train_message_id"
78
106
  t.index ["received_through_type", "received_through_id"], name: "index_message_train_receipts_on_received_through"
@@ -80,50 +108,56 @@ ActiveRecord::Schema.define(version: 20160207190409) do
80
108
  end
81
109
 
82
110
  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
111
+ t.datetime "created_at", precision: nil, null: false
112
+ t.integer "from_id"
113
+ t.string "from_type"
114
+ t.integer "recipient_id"
115
+ t.string "recipient_type"
116
+ t.datetime "updated_at", precision: nil, null: false
89
117
  t.index ["from_type", "from_id"], name: "unsubscribe_from"
90
118
  t.index ["recipient_type", "recipient_id", "from_type", "from_id"], name: "unsubscribe", unique: true
91
119
  t.index ["recipient_type", "recipient_id"], name: "unsubscribe_recipient"
92
120
  end
93
121
 
94
122
  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"
123
+ t.datetime "created_at", precision: nil
124
+ t.string "name"
125
+ t.integer "resource_id"
126
+ t.string "resource_type"
127
+ t.datetime "updated_at", precision: nil
100
128
  t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
101
129
  t.index ["name"], name: "index_roles_on_name"
102
130
  end
103
131
 
104
132
  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"
133
+ t.datetime "created_at", precision: nil, null: false
134
+ t.datetime "current_sign_in_at", precision: nil
135
+ t.string "current_sign_in_ip"
136
+ t.string "display_name"
137
+ t.string "email", default: "", null: false
138
+ t.string "encrypted_password", default: "", null: false
139
+ t.datetime "last_sign_in_at", precision: nil
140
+ t.string "last_sign_in_ip"
141
+ t.datetime "remember_created_at", precision: nil
142
+ t.datetime "reset_password_sent_at", precision: nil
143
+ t.string "reset_password_token"
144
+ t.integer "sign_in_count", default: 0, null: false
145
+ t.string "slug"
146
+ t.datetime "updated_at", precision: nil, null: false
119
147
  t.index ["email"], name: "index_users_on_email", unique: true
120
148
  t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
121
149
  end
122
150
 
123
151
  create_table "users_roles", id: false, force: :cascade do |t|
124
- t.integer "user_id"
125
152
  t.integer "role_id"
153
+ t.integer "user_id"
126
154
  t.index ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id"
127
155
  end
128
156
 
157
+ add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
158
+ add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
159
+ add_foreign_key "message_train_attachments", "message_train_messages"
160
+ add_foreign_key "message_train_ignores", "message_train_conversations"
161
+ add_foreign_key "message_train_messages", "message_train_conversations"
162
+ add_foreign_key "message_train_receipts", "message_train_messages"
129
163
  end