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.
- checksums.yaml +5 -5
- data/.gitattributes +1 -0
- data/.github/workflows/ci.yml +86 -0
- data/.gitignore +64 -0
- data/.rubocop.yml +9 -0
- data/.rubocop_todo.yml +854 -2
- data/.ruby-version +1 -1
- data/.simplecov +2 -4
- data/CHANGELOG.md +128 -0
- data/CLAUDE.md +5 -0
- data/Gemfile +29 -31
- data/LICENSE.txt +1 -1
- data/README.md +106 -35
- data/Rakefile +4 -18
- data/app/assets/stylesheets/message_train.scss +405 -67
- data/app/controllers/concerns/message_train_support.rb +2 -2
- data/app/controllers/message_train/boxes_controller.rb +4 -2
- data/app/controllers/message_train/conversations_controller.rb +1 -0
- data/app/helpers/message_train/application_helper.rb +68 -0
- data/app/helpers/message_train/attachments_helper.rb +7 -4
- data/app/helpers/message_train/conversations_helper.rb +16 -16
- data/app/helpers/message_train/messages_helper.rb +23 -10
- data/app/javascript/controllers/message_train/bulk_actions_controller.js +36 -0
- data/app/javascript/controllers/message_train/lightbox_controller.js +25 -0
- data/app/javascript/controllers/message_train/nested_form_controller.js +36 -0
- data/app/javascript/controllers/message_train/recipient_autocomplete_controller.js +31 -0
- data/app/mailers/message_train/previews/receipt_mailer_preview.rb +7 -5
- data/app/models/message_train/attachment.rb +54 -42
- data/app/models/message_train/box.rb +2 -2
- data/app/models/message_train/conversation.rb +28 -2
- data/app/models/message_train/ignore.rb +2 -2
- data/app/models/message_train/message.rb +10 -4
- data/app/models/message_train/receipt.rb +27 -4
- data/app/models/message_train/unsubscribe.rb +1 -1
- data/app/views/application/404.html.haml +1 -3
- data/app/views/kaminari/_first_page.html.haml +1 -1
- data/app/views/kaminari/_last_page.html.haml +1 -1
- data/app/views/kaminari/_next_page.html.haml +1 -1
- data/app/views/kaminari/_page.html.haml +3 -3
- data/app/views/kaminari/_paginator.html.haml +12 -11
- data/app/views/kaminari/_prev_page.html.haml +1 -1
- data/app/views/message_train/application/_attachment_fields.html.haml +10 -7
- data/app/views/message_train/application/_attachment_link.html.haml +2 -2
- data/app/views/message_train/application/_widget.html.haml +2 -4
- data/app/views/message_train/boxes/_widget.html.haml +5 -5
- data/app/views/message_train/boxes/show.html.haml +28 -45
- data/app/views/message_train/collectives/_widget.html.haml +4 -4
- data/app/views/message_train/conversations/_conversation.html.haml +11 -11
- data/app/views/message_train/conversations/_deleted_toggle.html.haml +1 -1
- data/app/views/message_train/conversations/_ignored_toggle.html.haml +2 -2
- data/app/views/message_train/conversations/_read_toggle.html.haml +2 -2
- data/app/views/message_train/conversations/_toggle.html.haml +6 -4
- data/app/views/message_train/conversations/_trashed_toggle.html.haml +2 -2
- data/app/views/message_train/conversations/show.html.haml +8 -6
- data/app/views/message_train/messages/_deleted_toggle.html.haml +1 -1
- data/app/views/message_train/messages/_form.html.haml +22 -30
- data/app/views/message_train/messages/_message.html.haml +27 -45
- data/app/views/message_train/messages/_read_toggle.html.haml +2 -2
- data/app/views/message_train/messages/_toggle.html.haml +5 -1
- data/app/views/message_train/messages/_trashed_toggle.html.haml +2 -2
- data/app/views/message_train/unsubscribes/index.html.haml +12 -15
- data/badges/coverage.json +1 -0
- data/config/importmap.rb +2 -0
- data/config/locales/en.yml +6 -3
- data/db/migrate/20150721145319_create_message_train_conversations.rb +1 -1
- data/db/migrate/20150721160322_create_message_train_messages.rb +1 -1
- data/db/migrate/20150721161144_create_message_train_attachments.rb +5 -2
- data/db/migrate/20150721161940_create_message_train_receipts.rb +1 -1
- data/db/migrate/20150721163838_create_message_train_ignores.rb +1 -1
- data/db/migrate/20150901183458_add_received_through_to_message_train_receipts.rb +1 -1
- data/db/migrate/20151004184347_add_unique_index_to_receipts.rb +1 -1
- data/db/migrate/20151124000820_create_message_train_unsubscribes.rb +1 -1
- data/db/migrate/20260827095938_remove_paperclip_columns_from_message_train_attachments.rb +8 -0
- data/db/migrate/20260827171549_remove_body_from_message_train_messages.rb +5 -0
- data/db/migrate/20260827180000_add_marking_indexes.rb +9 -0
- data/db/migrate/20260827200000_add_body_back_to_message_train_messages.rb +5 -0
- data/docs/screenshots/inbox-desktop.png +0 -0
- data/docs/screenshots/inbox-mobile.png +0 -0
- data/lib/generators/message_train/install/install_generator.rb +1 -1
- data/lib/message_train/engine.rb +11 -0
- data/lib/message_train/instance_methods.rb +13 -7
- data/lib/message_train/localization.rb +4 -3
- data/lib/message_train/version.rb +1 -1
- data/lib/message_train.rb +0 -2
- data/message_train.gemspec +57 -389
- data/spec/controllers/message_train/boxes_controller_spec.rb +13 -8
- data/spec/controllers/message_train/concerns_spec.rb +2 -2
- data/spec/controllers/message_train/conversations_controller_spec.rb +36 -7
- data/spec/controllers/message_train/messages_controller_spec.rb +4 -4
- data/spec/dummy/app/assets/stylesheets/application.scss +141 -12
- data/spec/dummy/app/controllers/application_controller.rb +1 -1
- data/spec/dummy/app/javascript/application.js +4 -0
- data/spec/dummy/app/javascript/controllers/application.js +9 -0
- data/spec/dummy/app/javascript/controllers/index.js +4 -0
- data/spec/dummy/app/models/role.rb +1 -1
- data/spec/dummy/app/views/active_storage/blobs/_blob.html.erb +14 -0
- data/spec/dummy/app/views/layouts/_top_navigation.html.haml +18 -7
- data/spec/dummy/app/views/layouts/application.html.haml +22 -26
- data/spec/dummy/bin/importmap +4 -0
- data/spec/dummy/config/application.rb +7 -20
- data/spec/dummy/config/environments/development.rb +17 -21
- data/spec/dummy/config/environments/production.rb +11 -63
- data/spec/dummy/config/environments/test.rb +21 -16
- data/spec/dummy/config/importmap.rb +7 -0
- data/spec/dummy/config/initializers/assets.rb +1 -6
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/config/storage.yml +7 -0
- data/spec/dummy/db/migrate/20150721140013_devise_create_users.rb +1 -1
- data/spec/dummy/db/migrate/20150721141009_rolify_create_roles.rb +1 -1
- data/spec/dummy/db/migrate/20150721141128_create_groups.rb +1 -1
- data/spec/dummy/db/migrate/20150721150307_add_display_name_column_to_users.rb +1 -1
- data/spec/dummy/db/migrate/20160207190402_create_message_train_conversations.message_train.rb +1 -1
- data/spec/dummy/db/migrate/20160207190403_create_message_train_messages.message_train.rb +1 -1
- data/spec/dummy/db/migrate/20160207190404_create_message_train_attachments.message_train.rb +5 -2
- data/spec/dummy/db/migrate/20160207190405_create_message_train_receipts.message_train.rb +1 -1
- data/spec/dummy/db/migrate/20160207190406_create_message_train_ignores.message_train.rb +1 -1
- data/spec/dummy/db/migrate/20160207190407_add_received_through_to_message_train_receipts.message_train.rb +1 -1
- data/spec/dummy/db/migrate/20160207190408_add_unique_index_to_receipts.message_train.rb +1 -1
- data/spec/dummy/db/migrate/20160207190409_create_message_train_unsubscribes.message_train.rb +1 -1
- data/spec/dummy/db/migrate/20260827095939_remove_paperclip_columns_from_message_train_attachments.message_train.rb +9 -0
- data/spec/dummy/db/migrate/20260827161141_create_active_storage_tables.active_storage.rb +57 -0
- data/spec/dummy/db/migrate/20260827171550_remove_body_from_message_train_messages.message_train.rb +6 -0
- data/spec/dummy/db/migrate/20260827225116_add_marking_indexes.message_train.rb +10 -0
- data/spec/dummy/db/migrate/20260828034830_add_body_back_to_message_train_messages.message_train.rb +6 -0
- data/spec/dummy/db/migrate/20260828040000_drop_action_text_tables.rb +5 -0
- data/spec/dummy/db/schema.rb +106 -72
- data/spec/dummy/db/seeds/conversations.seeds.rb +22 -22
- data/spec/dummy/db/seeds/development/conversations.seeds.rb +2 -2
- data/spec/dummy/db/seeds/groups.seeds.rb +4 -4
- data/spec/dummy/db/seeds/test/attachments.seeds.rb +4 -4
- data/spec/dummy/db/seeds/test/conversations.seeds.rb +2 -2
- data/spec/dummy/db/seeds/users.seeds.rb +8 -8
- data/spec/dummy/vendor/javascript/.keep +0 -0
- data/spec/factories/attachment.rb +5 -6
- data/spec/factories/group.rb +2 -2
- data/spec/factories/message.rb +7 -7
- data/spec/factories/user.rb +3 -3
- data/spec/features/boxes_spec.rb +38 -34
- data/spec/features/conversations_spec.rb +13 -6
- data/spec/features/messages_spec.rb +20 -20
- data/spec/features/unsubscribes_spec.rb +9 -9
- data/spec/helpers/message_train/application_helper_spec.rb +16 -18
- data/spec/helpers/message_train/attachment_helper_spec.rb +8 -18
- data/spec/helpers/message_train/boxes_helper_spec.rb +6 -6
- data/spec/helpers/message_train/collectives_helper_spec.rb +10 -10
- data/spec/helpers/message_train/conversations_helper_spec.rb +43 -85
- data/spec/helpers/message_train/messages_helper_spec.rb +41 -61
- data/spec/models/message_train/attachment_spec.rb +26 -36
- data/spec/models/message_train/box_spec.rb +2 -2
- data/spec/models/message_train/conversation_spec.rb +15 -0
- data/spec/models/message_train/message_spec.rb +5 -1
- data/spec/models/message_train/receipt_spec.rb +1 -1
- data/spec/models/message_train/unsubscribe_spec.rb +1 -1
- data/spec/rails_helper.rb +14 -13
- data/spec/support/controller_behaviors.rb +13 -13
- data/spec/support/factory_bot.rb +3 -0
- data/spec/support/feature_behaviors.rb +14 -14
- data/spec/support/loaded_site/attachments.rb +6 -2
- data/spec/support/utilities.rb +49 -20
- metadata +260 -213
- data/.travis.yml +0 -12
- data/VERSION +0 -1
- data/app/assets/javascripts/ckeditor/config.js +0 -49
- data/app/assets/javascripts/message_train.js +0 -149
- data/spec/dummy/app/assets/javascripts/application.js +0 -17
- data/spec/dummy/app/assets/stylesheets/bootstrap-everything.scss +0 -54
- data/spec/dummy/config/initializers/bootstrap_leather.rb +0 -7
- data/spec/dummy/config/initializers/paperclip.rb +0 -5
- data/spec/dummy/config/secrets.yml +0 -22
- data/spec/dummy/db/test.sqlite3 +0 -0
- 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.
|
|
6
|
+
config.enable_reloading = false
|
|
7
7
|
|
|
8
|
-
# Eager load code on boot
|
|
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
|
|
15
|
-
config.consider_all_requests_local
|
|
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
|
-
#
|
|
47
|
-
|
|
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
|
-
#
|
|
67
|
-
|
|
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.
|
|
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.
|
|
9
|
+
config.enable_reloading = false
|
|
10
10
|
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
|
|
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
|
|
17
|
-
config.public_file_server.
|
|
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
|
|
23
|
-
config.consider_all_requests_local
|
|
24
|
-
config.
|
|
20
|
+
# Show full error reports.
|
|
21
|
+
config.consider_all_requests_local = true
|
|
22
|
+
config.cache_store = :null_store
|
|
25
23
|
|
|
26
|
-
#
|
|
27
|
-
config.action_dispatch.show_exceptions =
|
|
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.
|
|
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 )
|
data/spec/dummy/config/routes.rb
CHANGED
data/spec/dummy/db/migrate/20160207190402_create_message_train_conversations.message_train.rb
CHANGED
|
@@ -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.
|
|
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
|
data/spec/dummy/db/migrate/20160207190409_create_message_train_unsubscribes.message_train.rb
CHANGED
|
@@ -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,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
|
data/spec/dummy/db/schema.rb
CHANGED
|
@@ -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
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
# from scratch.
|
|
9
|
-
#
|
|
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:
|
|
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.
|
|
17
|
-
t.
|
|
18
|
-
t.
|
|
19
|
-
t.
|
|
20
|
-
t.datetime "updated_at",
|
|
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.
|
|
25
|
-
t.
|
|
26
|
-
t.
|
|
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.
|
|
36
|
-
t.
|
|
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.
|
|
42
|
-
t.integer
|
|
43
|
-
t.integer
|
|
44
|
-
t.
|
|
45
|
-
t.datetime "updated_at",
|
|
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.
|
|
52
|
-
t.
|
|
53
|
-
t.
|
|
54
|
-
t.
|
|
55
|
-
t.
|
|
56
|
-
t.
|
|
57
|
-
t.
|
|
58
|
-
t.
|
|
59
|
-
t.datetime "updated_at",
|
|
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.
|
|
66
|
-
t.
|
|
67
|
-
t.
|
|
68
|
-
t.boolean
|
|
69
|
-
t.
|
|
70
|
-
t.
|
|
71
|
-
t.
|
|
72
|
-
t.
|
|
73
|
-
t.
|
|
74
|
-
t.
|
|
75
|
-
t.
|
|
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.
|
|
84
|
-
t.integer
|
|
85
|
-
t.string
|
|
86
|
-
t.integer
|
|
87
|
-
t.
|
|
88
|
-
t.datetime "updated_at",
|
|
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.
|
|
96
|
-
t.string
|
|
97
|
-
t.integer
|
|
98
|
-
t.
|
|
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.
|
|
106
|
-
t.
|
|
107
|
-
t.string
|
|
108
|
-
t.
|
|
109
|
-
t.
|
|
110
|
-
t.
|
|
111
|
-
t.datetime "
|
|
112
|
-
t.
|
|
113
|
-
t.
|
|
114
|
-
t.
|
|
115
|
-
t.
|
|
116
|
-
t.
|
|
117
|
-
t.string
|
|
118
|
-
t.
|
|
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
|