trusty-cms 7.1.0 → 7.1.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/stylesheets/admin/assets.scss +5 -0
- data/app/controllers/admin/assets_controller.rb +6 -2
- data/app/models/asset.rb +38 -11
- data/app/views/admin/configuration/_clipped_edit.html.haml +1 -0
- data/app/views/admin/configuration/_clipped_show.html.haml +2 -0
- data/config/database.yml +30 -0
- data/config/initializers/trusty_cms_config.rb +2 -1
- data/config/locales/en.yml +5 -0
- data/lib/trusty_cms/version.rb +1 -1
- data/spec/dummy/log/development.log +345 -0
- data/spec/dummy/log/test.log +0 -0
- data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +0 -0
- data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +0 -0
- data/spec/dummy/tmp/local_secret.txt +1 -0
- data/spec/dummy/tmp/trusty_config_cache.txt +0 -0
- data/spec/models/asset_spec.rb +169 -12
- data/trusty_cms.gemspec +1 -1
- data/vendor/extensions/clipped-extension/clipped_extension.rb +3 -4
- data/vendor/extensions/clipped-extension/lib/generators/templates/clipped_config.rb +2 -1
- data/yarn.lock +9 -9
- metadata +17 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1a7f52b7348e786e89e3229147fa20d111295ed8fb1c6b0a91a9ee9e1181efae
|
|
4
|
+
data.tar.gz: d8b45f266e546159fb7ab00a50f1dbc0ad8f0da5ae745a667da68186c015a984
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4818827adbde56816225a34298bc7a54115b3d1e746b7b03d2fa70a87d89b65d4fcf1b7a52a7317785cecf0cac69d933505bae64c075ee67f77a16ffe1d7e125
|
|
7
|
+
data.tar.gz: 32ed335cc892c7ac42a85a200f18f5da7c6ab7d763349ef1cb18abcd8dc1d91bce83df25662a0eecad02186ba396da3bd5741103f8878f70970c311ac405de1c
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
class Admin::AssetsController < Admin::ResourceController
|
|
2
2
|
paginate_models(per_page: 50)
|
|
3
3
|
COMPRESS_FILE_TYPE = ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml'].freeze
|
|
4
|
-
APPROVED_CONTENT_TYPES = Asset::APPROVED_CONTENT_TYPES
|
|
5
4
|
|
|
6
5
|
def index
|
|
7
6
|
assets = Asset.order('created_at DESC')
|
|
@@ -52,6 +51,7 @@ class Admin::AssetsController < Admin::ResourceController
|
|
|
52
51
|
@page_attachments = []
|
|
53
52
|
uploads = Array(asset_params.dig('asset', 'asset')).reject(&:blank?)
|
|
54
53
|
|
|
54
|
+
|
|
55
55
|
uploads.each do |uploaded_asset|
|
|
56
56
|
result = process_uploaded_asset(uploaded_asset)
|
|
57
57
|
|
|
@@ -64,11 +64,15 @@ class Admin::AssetsController < Admin::ResourceController
|
|
|
64
64
|
@assets << @asset
|
|
65
65
|
else
|
|
66
66
|
flash[result.fetch(:flash_type, :error)] = result[:error]
|
|
67
|
+
@errors = result[:error]
|
|
67
68
|
end
|
|
68
69
|
end
|
|
69
70
|
|
|
70
71
|
if asset_params[:for_attachment]
|
|
71
72
|
render partial: 'admin/page_attachments/attachment', collection: @page_attachments
|
|
73
|
+
elsif @errors.present?
|
|
74
|
+
flash[:error] = @errors
|
|
75
|
+
redirect_to new_admin_asset_path
|
|
72
76
|
else
|
|
73
77
|
response_for :create
|
|
74
78
|
end
|
|
@@ -83,7 +87,7 @@ class Admin::AssetsController < Admin::ResourceController
|
|
|
83
87
|
return failure_response('Please only upload assets that have a valid extension in the name.', :unprocessable_entity, :notice)
|
|
84
88
|
end
|
|
85
89
|
|
|
86
|
-
unless
|
|
90
|
+
unless Asset.approved_content_types.include?(uploaded_asset.content_type)
|
|
87
91
|
return failure_response('Unsupported file type.', :unsupported_media_type, :error)
|
|
88
92
|
end
|
|
89
93
|
|
data/app/models/asset.rb
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
require 'trusty_cms/geometry'
|
|
2
2
|
|
|
3
3
|
class Asset < ActiveRecord::Base
|
|
4
|
-
APPROVED_CONTENT_TYPES = %w[application/zip image/jpg image/jpeg image/png image/gif application/pdf text/css text/calendar].freeze
|
|
5
|
-
|
|
6
4
|
has_many :page_attachments, dependent: :destroy
|
|
7
5
|
has_many :pages, through: :page_attachments
|
|
8
6
|
has_site if respond_to? :has_site
|
|
@@ -37,18 +35,32 @@ class Asset < ActiveRecord::Base
|
|
|
37
35
|
end
|
|
38
36
|
}
|
|
39
37
|
|
|
38
|
+
def self.approved_content_types
|
|
39
|
+
AssetType.known_mimetypes
|
|
40
|
+
end
|
|
41
|
+
|
|
40
42
|
has_one_attached :asset
|
|
41
|
-
validates :asset,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
content_type: APPROVED_CONTENT_TYPES,
|
|
46
|
-
size_range: 1..10.megabytes,
|
|
47
|
-
}
|
|
43
|
+
validates :asset, presence: true
|
|
44
|
+
validate :asset_within_configured_size, if: -> { asset.attached? }
|
|
45
|
+
validate :approved_content_type, if: -> { asset.attached? }
|
|
48
46
|
before_validation :sync_attachment_metadata
|
|
49
47
|
before_save :assign_title
|
|
50
48
|
before_save :assign_uuid
|
|
51
49
|
|
|
50
|
+
def asset_within_configured_size
|
|
51
|
+
limit_mb =
|
|
52
|
+
if video_content_type?
|
|
53
|
+
TrustyCms.config['assets.max_video_size'].to_i
|
|
54
|
+
else
|
|
55
|
+
TrustyCms.config['assets.max_asset_size'].to_i
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
limit_bytes = limit_mb.megabytes
|
|
59
|
+
return if asset.blob.byte_size.between?(1, limit_bytes)
|
|
60
|
+
|
|
61
|
+
errors.add(:asset, :wrong_size_error, limit_mb: limit_mb)
|
|
62
|
+
end
|
|
63
|
+
|
|
52
64
|
def asset_type
|
|
53
65
|
AssetType.for(asset)
|
|
54
66
|
end
|
|
@@ -75,6 +87,8 @@ class Asset < ActiveRecord::Base
|
|
|
75
87
|
to: :asset_type
|
|
76
88
|
|
|
77
89
|
def thumbnail(style_name = 'normal')
|
|
90
|
+
return rewrite_cloud_url(asset.url) if asset.attached? && content_type == 'application/pdf'
|
|
91
|
+
|
|
78
92
|
variant = asset_variant(style_name.to_s)
|
|
79
93
|
return rewrite_cloud_url(variant.processed.url) if variant
|
|
80
94
|
|
|
@@ -96,8 +110,11 @@ class Asset < ActiveRecord::Base
|
|
|
96
110
|
%w[asset_content_type asset_file_name asset_file_size caption created_at created_by_id id original_extension original_height original_width title updated_at updated_by_id uuid]
|
|
97
111
|
end
|
|
98
112
|
|
|
99
|
-
def render_original(
|
|
100
|
-
|
|
113
|
+
def render_original(_style_name)
|
|
114
|
+
return false unless asset.attached?
|
|
115
|
+
|
|
116
|
+
prefix = TrustyCms::Config['assets.storage.prefix'].presence
|
|
117
|
+
prefix ? asset.key.start_with?(prefix) : asset.key.include?('/')
|
|
101
118
|
end
|
|
102
119
|
|
|
103
120
|
def asset_variant(style_name)
|
|
@@ -235,6 +252,16 @@ class Asset < ActiveRecord::Base
|
|
|
235
252
|
end
|
|
236
253
|
end
|
|
237
254
|
|
|
255
|
+
def video_content_type?
|
|
256
|
+
AssetType.known?(:video) && AssetType.find(:video).mime_types.include?(content_type)
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
def approved_content_type
|
|
260
|
+
return if Asset.approved_content_types.include?(asset.content_type)
|
|
261
|
+
|
|
262
|
+
errors.add(:asset, :content_type, filename: asset.filename.to_s)
|
|
263
|
+
end
|
|
264
|
+
|
|
238
265
|
def sync_attachment_metadata
|
|
239
266
|
return unless asset.attached?
|
|
240
267
|
|
data/config/database.yml
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This is only an example configuration. Please see the Rails
|
|
3
|
+
# documentation for more details.
|
|
4
|
+
#
|
|
5
|
+
defaults: &defaults
|
|
6
|
+
adapter: mysql
|
|
7
|
+
db: localhost
|
|
8
|
+
|
|
9
|
+
development:
|
|
10
|
+
adapter: mysql2
|
|
11
|
+
database: trusty_cms_dev
|
|
12
|
+
username: root
|
|
13
|
+
password:
|
|
14
|
+
|
|
15
|
+
test: &TEST
|
|
16
|
+
adapter: mysql2
|
|
17
|
+
database: trusty_cms_test
|
|
18
|
+
username: root
|
|
19
|
+
password: ''
|
|
20
|
+
db: '127.0.0.1'
|
|
21
|
+
port: 0
|
|
22
|
+
encoding: utf8mb4
|
|
23
|
+
charset: utf8mb4
|
|
24
|
+
collation: utf8mb4_bin
|
|
25
|
+
|
|
26
|
+
production:
|
|
27
|
+
adapter: mysql2
|
|
28
|
+
database: trusty_cms_live
|
|
29
|
+
username: root
|
|
30
|
+
password:
|
|
@@ -29,7 +29,8 @@ Rails.application.reloader.to_prepare do
|
|
|
29
29
|
thumbs.define 'pdf', default: 'normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg'
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
assets.define 'max_asset_size', default:
|
|
32
|
+
assets.define 'max_asset_size', default: 10, type: :integer, units: 'MB'
|
|
33
|
+
assets.define 'max_video_size', default: 50, type: :integer, units: 'MB'
|
|
33
34
|
assets.define 'display_size', default: 'normal', allow_blank: true
|
|
34
35
|
assets.define 'insertion_size', default: 'normal', allow_blank: true
|
|
35
36
|
end
|
data/config/locales/en.yml
CHANGED
|
@@ -17,6 +17,10 @@ en:
|
|
|
17
17
|
attributes:
|
|
18
18
|
asset:
|
|
19
19
|
blank: 'You must choose a file to upload!'
|
|
20
|
+
content_type: '%{filename} is not a supported file type.'
|
|
21
|
+
max_size_error: 'File is too large (maximum is %{max_size}).'
|
|
22
|
+
min_size_error: 'File is too small (minimum is %{min_size}).'
|
|
23
|
+
wrong_size_error: 'File size must be between 1 byte and %{limit_mb} MB'
|
|
20
24
|
page:
|
|
21
25
|
attributes:
|
|
22
26
|
slug:
|
|
@@ -134,6 +138,7 @@ en:
|
|
|
134
138
|
display_size: 'Display Size'
|
|
135
139
|
insertion_size: 'Insertion Size'
|
|
136
140
|
max_asset_size: 'Max Asset Size'
|
|
141
|
+
max_video_size: 'Max Video Size'
|
|
137
142
|
path: 'Path'
|
|
138
143
|
s3:
|
|
139
144
|
bucket: 'Bucket'
|
data/lib/trusty_cms/version.rb
CHANGED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
[1m[35m (0.5ms)[0m [1m[35mCREATE DATABASE `trusty_cms_dev` DEFAULT CHARACTER SET `utf8mb4`[0m
|
|
2
|
+
[1m[35m (15.0ms)[0m [1m[35mCREATE DATABASE `trusty_cms_test` DEFAULT COLLATE `utf8mb4_bin`[0m
|
|
3
|
+
[1m[35m (40.9ms)[0m [1m[35mCREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL PRIMARY KEY)[0m
|
|
4
|
+
[1m[35m (14.6ms)[0m [1m[35mCREATE TABLE `ar_internal_metadata` (`key` varchar(255) NOT NULL PRIMARY KEY, `value` varchar(255), `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL)[0m
|
|
5
|
+
[1m[35m (0.7ms)[0m [1m[34mSELECT GET_LOCK('6658685849647950510', 0)[0m
|
|
6
|
+
[1m[36mActiveRecord::SchemaMigration Load (12.3ms)[0m [1m[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC[0m
|
|
7
|
+
[1m[36mActiveRecord::InternalMetadata Load (1.8ms)[0m [1m[34mSELECT * FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' ORDER BY `ar_internal_metadata`.`key` ASC LIMIT 1[0m
|
|
8
|
+
[1m[36mActiveRecord::InternalMetadata Create (1.5ms)[0m [1m[32mINSERT INTO `ar_internal_metadata` (`key`, `value`, `created_at`, `updated_at`) VALUES ('environment', 'development', '2026-04-20 21:10:45.666344', '2026-04-20 21:10:45.666346')[0m
|
|
9
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT RELEASE_LOCK('6658685849647950510')[0m
|
|
10
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC[0m
|
|
11
|
+
[1m[35m (13.1ms)[0m [1m[35mDROP TABLE `ar_internal_metadata`[0m
|
|
12
|
+
[1m[35m (13.9ms)[0m [1m[35mDROP TABLE `schema_migrations`[0m
|
|
13
|
+
[1m[35m (13.9ms)[0m [1m[35mCREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL PRIMARY KEY)[0m
|
|
14
|
+
[1m[35m (8.6ms)[0m [1m[35mCREATE TABLE `ar_internal_metadata` (`key` varchar(255) NOT NULL PRIMARY KEY, `value` varchar(255), `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL)[0m
|
|
15
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT GET_LOCK('6658685849647950510', 0)[0m
|
|
16
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.8ms)[0m [1m[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC[0m
|
|
17
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.9ms)[0m [1m[34mSELECT * FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' ORDER BY `ar_internal_metadata`.`key` ASC LIMIT 1[0m
|
|
18
|
+
[1m[36mActiveRecord::InternalMetadata Create (1.0ms)[0m [1m[32mINSERT INTO `ar_internal_metadata` (`key`, `value`, `created_at`, `updated_at`) VALUES ('environment', 'development', '2026-04-20 21:11:12.190041', '2026-04-20 21:11:12.190057')[0m
|
|
19
|
+
Migrating to CreateTrustyTables (20260420211055)
|
|
20
|
+
[1m[35m (2.1ms)[0m [1m[35mDROP TABLE IF EXISTS `config`[0m
|
|
21
|
+
[1m[35m (12.9ms)[0m [1m[35mCREATE TABLE `config` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `key` varchar(40) DEFAULT '' NOT NULL, `value` varchar(255) DEFAULT '')[0m
|
|
22
|
+
[1m[35m (12.8ms)[0m [1m[35mCREATE UNIQUE INDEX `key` ON `config` (`key`)[0m
|
|
23
|
+
[1m[35m (1.3ms)[0m [1m[35mDROP TABLE IF EXISTS `pages`[0m
|
|
24
|
+
[1m[35m (14.3ms)[0m [1m[35mCREATE TABLE `pages` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `title` varchar(255), `slug` varchar(100), `breadcrumb` varchar(160), `class_name` varchar(25), `status_id` int DEFAULT 1 NOT NULL, `parent_id` int, `layout_id` int, `created_at` datetime, `updated_at` datetime, `published_at` datetime, `created_by` int, `updated_by` int)[0m
|
|
25
|
+
[1m[35m (1.2ms)[0m [1m[35mDROP TABLE IF EXISTS `page_parts`[0m
|
|
26
|
+
[1m[35m (16.2ms)[0m [1m[35mCREATE TABLE `page_parts` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(100), `filter` varchar(25), `content` text, `page_id` int)[0m
|
|
27
|
+
[1m[35m (1.1ms)[0m [1m[35mDROP TABLE IF EXISTS `snippets`[0m
|
|
28
|
+
[1m[35m (16.8ms)[0m [1m[35mCREATE TABLE `snippets` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(100) DEFAULT '' NOT NULL, `filter` varchar(25), `content` text, `created_at` datetime, `updated_at` datetime, `created_by` int, `updated_by` int)[0m
|
|
29
|
+
[1m[35m (15.8ms)[0m [1m[35mCREATE UNIQUE INDEX `name` ON `snippets` (`name`)[0m
|
|
30
|
+
[1m[35m (0.9ms)[0m [1m[35mDROP TABLE IF EXISTS `layouts`[0m
|
|
31
|
+
[1m[35m (13.8ms)[0m [1m[35mCREATE TABLE `layouts` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(100), `content` text, `created_at` datetime, `updated_at` datetime, `created_by` int, `updated_by` int)[0m
|
|
32
|
+
[1m[35m (8.7ms)[0m [1m[35mDROP TABLE IF EXISTS `users`[0m
|
|
33
|
+
[1m[35m (14.6ms)[0m [1m[35mCREATE TABLE `users` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(100), `email` varchar(255), `login` varchar(40) DEFAULT '' NOT NULL, `password` varchar(40), `admin` tinyint(1) DEFAULT FALSE NOT NULL, `developer` tinyint(1) DEFAULT FALSE NOT NULL, `created_at` datetime, `updated_at` datetime, `created_by` int, `updated_by` int, `salt` varchar(255))[0m
|
|
34
|
+
[1m[35m (13.0ms)[0m [1m[35mCREATE UNIQUE INDEX `login` ON `users` (`login`)[0m
|
|
35
|
+
[1m[36mActiveRecord::SchemaMigration Create (1.3ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211055')[0m
|
|
36
|
+
Migrating to InsertInitialData (20260420211056)
|
|
37
|
+
[1m[36mActiveRecord::SchemaMigration Create (6.9ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211056')[0m
|
|
38
|
+
Migrating to RenameFilterColumn (20260420211057)
|
|
39
|
+
[1m[35m (16.8ms)[0m [1m[35mALTER TABLE `page_parts` RENAME COLUMN `filter` TO `filter_id`[0m
|
|
40
|
+
[1m[35m (6.2ms)[0m [1m[35mALTER TABLE `snippets` RENAME COLUMN `filter` TO `filter_id`[0m
|
|
41
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211057')[0m
|
|
42
|
+
Migrating to AddVirtualColumnToPage (20260420211058)
|
|
43
|
+
[1m[35m (19.3ms)[0m [1m[35mALTER TABLE `pages` ADD `virtual` tinyint(1) DEFAULT FALSE NOT NULL[0m
|
|
44
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.7ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211058')[0m
|
|
45
|
+
Migrating to RemoveUserLoginIndex (20260420211059)
|
|
46
|
+
[1m[35m (3.7ms)[0m [1m[35mDROP INDEX `login` ON `users`[0m
|
|
47
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211059')[0m
|
|
48
|
+
Migrating to RemoveVirtualColumnFromPage (20260420211060)
|
|
49
|
+
[1m[35m (17.9ms)[0m [1m[35mALTER TABLE `pages` DROP COLUMN `virtual`[0m
|
|
50
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.5ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211060')[0m
|
|
51
|
+
Migrating to AddVirtualColumnToPageAgain (20260420211061)
|
|
52
|
+
[1m[35m (12.8ms)[0m [1m[35mALTER TABLE `pages` ADD `virtual` tinyint(1) DEFAULT FALSE NOT NULL[0m
|
|
53
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211061')[0m
|
|
54
|
+
Migrating to AddContentTypeFieldToLayout (20260420211062)
|
|
55
|
+
[1m[35m (20.6ms)[0m [1m[35mALTER TABLE `layouts` ADD `content_type` varchar(40)[0m
|
|
56
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211062')[0m
|
|
57
|
+
Migrating to CreateSites (20260420211063)
|
|
58
|
+
[1m[35m (5.4ms)[0m [1m[35mCREATE TABLE `sites` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(255), `domain` varchar(255), `homepage_id` int)[0m
|
|
59
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211063')[0m
|
|
60
|
+
Migrating to AddOrderToSites (20260420211064)
|
|
61
|
+
[1m[35m (17.9ms)[0m [1m[35mALTER TABLE `sites` ADD `position` int DEFAULT 0[0m
|
|
62
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.6ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211064')[0m
|
|
63
|
+
Migrating to CreateExtensionMeta (20260420211065)
|
|
64
|
+
[1m[35m (0.4ms)[0m [1m[35mDROP TABLE IF EXISTS `extension_meta`[0m
|
|
65
|
+
[1m[35m (6.0ms)[0m [1m[35mCREATE TABLE `extension_meta` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(255), `schema_version` int DEFAULT 0, `enabled` tinyint(1) DEFAULT TRUE)[0m
|
|
66
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.6ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211065')[0m
|
|
67
|
+
Migrating to AddNotesFieldToUser (20260420211066)
|
|
68
|
+
[1m[35m (32.5ms)[0m [1m[35mALTER TABLE `users` ADD `notes` text[0m
|
|
69
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.5ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211066')[0m
|
|
70
|
+
Migrating to RenameConfigDefaultPartsKey (20260420211067)
|
|
71
|
+
[1m[36mTrustyCms::Config Load (0.2ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'default.parts' LIMIT 1[0m
|
|
72
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211067')[0m
|
|
73
|
+
Migrating to AddOptimisticLocking (20260420211068)
|
|
74
|
+
[1m[35m (22.6ms)[0m [1m[35mALTER TABLE `pages` ADD `lock_version` int DEFAULT 0[0m
|
|
75
|
+
[1m[35m (61.6ms)[0m [1m[35mALTER TABLE `layouts` ADD `lock_version` int DEFAULT 0[0m
|
|
76
|
+
[1m[35m (53.1ms)[0m [1m[35mALTER TABLE `snippets` ADD `lock_version` int DEFAULT 0[0m
|
|
77
|
+
[1m[35m (94.7ms)[0m [1m[35mALTER TABLE `users` ADD `lock_version` int DEFAULT 0[0m
|
|
78
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.5ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211068')[0m
|
|
79
|
+
Migrating to AddSessions (20260420211069)
|
|
80
|
+
[1m[35m (47.7ms)[0m [1m[35mCREATE TABLE `sessions` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `session_id` varchar(255), `data` text, `updated_at` datetime)[0m
|
|
81
|
+
[1m[35m (8.7ms)[0m [1m[35mCREATE INDEX `index_sessions_on_session_id` ON `sessions` (`session_id`)[0m
|
|
82
|
+
[1m[35m (8.0ms)[0m [1m[35mCREATE INDEX `index_sessions_on_updated_at` ON `sessions` (`updated_at`)[0m
|
|
83
|
+
[1m[36mActiveRecord::SchemaMigration Create (1.1ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211069')[0m
|
|
84
|
+
Migrating to RenameCreatedByUpdatedByColumns (20260420211070)
|
|
85
|
+
[1m[35m (12.8ms)[0m [1m[35mALTER TABLE `pages` RENAME COLUMN `created_by` TO `created_by_id`[0m
|
|
86
|
+
[1m[35m (7.3ms)[0m [1m[35mALTER TABLE `pages` RENAME COLUMN `updated_by` TO `updated_by_id`[0m
|
|
87
|
+
[1m[35m (8.1ms)[0m [1m[35mALTER TABLE `snippets` RENAME COLUMN `created_by` TO `created_by_id`[0m
|
|
88
|
+
[1m[35m (4.4ms)[0m [1m[35mALTER TABLE `snippets` RENAME COLUMN `updated_by` TO `updated_by_id`[0m
|
|
89
|
+
[1m[35m (5.2ms)[0m [1m[35mALTER TABLE `layouts` RENAME COLUMN `created_by` TO `created_by_id`[0m
|
|
90
|
+
[1m[35m (6.2ms)[0m [1m[35mALTER TABLE `layouts` RENAME COLUMN `updated_by` TO `updated_by_id`[0m
|
|
91
|
+
[1m[35m (4.8ms)[0m [1m[35mALTER TABLE `users` RENAME COLUMN `created_by` TO `created_by_id`[0m
|
|
92
|
+
[1m[35m (5.7ms)[0m [1m[35mALTER TABLE `users` RENAME COLUMN `updated_by` TO `updated_by_id`[0m
|
|
93
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.7ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211070')[0m
|
|
94
|
+
Migrating to AddDescriptionAndKeywordsToPages (20260420211071)
|
|
95
|
+
[1m[35m (12.3ms)[0m [1m[35mALTER TABLE `pages` ADD `description` varchar(255)[0m
|
|
96
|
+
[1m[35m (14.2ms)[0m [1m[35mALTER TABLE `pages` ADD `keywords` varchar(255)[0m
|
|
97
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211071')[0m
|
|
98
|
+
Migrating to AddSessionInfoToUsers (20260420211072)
|
|
99
|
+
[1m[35m (10.7ms)[0m [1m[35mALTER TABLE `users` ADD `session_token` varchar(255)[0m
|
|
100
|
+
[1m[35m (14.3ms)[0m [1m[35mALTER TABLE `users` ADD `session_expire` datetime[0m
|
|
101
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.5ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211072')[0m
|
|
102
|
+
Migrating to RemoveSessionExpireFromUsers (20260420211073)
|
|
103
|
+
[1m[35m (11.1ms)[0m [1m[35mALTER TABLE `users` DROP COLUMN `session_expire`[0m
|
|
104
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211073')[0m
|
|
105
|
+
Migrating to AddAdminFieldsToSites (20260420211074)
|
|
106
|
+
[1m[35m (5.5ms)[0m [1m[35mALTER TABLE `sites` ADD `created_by_id` int[0m
|
|
107
|
+
[1m[35m (9.0ms)[0m [1m[35mALTER TABLE `sites` ADD `created_at` datetime[0m
|
|
108
|
+
[1m[35m (17.4ms)[0m [1m[35mALTER TABLE `sites` ADD `updated_by_id` int[0m
|
|
109
|
+
[1m[35m (8.1ms)[0m [1m[35mALTER TABLE `sites` ADD `updated_at` datetime[0m
|
|
110
|
+
[1m[35m (4.3ms)[0m [1m[35mALTER TABLE `sites` ADD `subtitle` varchar(255)[0m
|
|
111
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211074')[0m
|
|
112
|
+
Migrating to AddSites (20260420211075)
|
|
113
|
+
[1m[35m (8.1ms)[0m [1m[35mALTER TABLE `layouts` ADD `site_id` int[0m
|
|
114
|
+
[1m[35m (7.3ms)[0m [1m[35mALTER TABLE `snippets` ADD `site_id` int[0m
|
|
115
|
+
[1m[35m (5.9ms)[0m [1m[35mALTER TABLE `users` ADD `site_id` int[0m
|
|
116
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211075')[0m
|
|
117
|
+
Migrating to SiteAbbreviation (20260420211076)
|
|
118
|
+
[1m[35m (7.3ms)[0m [1m[35mALTER TABLE `sites` ADD `abbreviation` varchar(255)[0m
|
|
119
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.5ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211076')[0m
|
|
120
|
+
Migrating to RecreateNonUniqueIndexOnSnippetsName (20260420211077)
|
|
121
|
+
[1m[35m (3.4ms)[0m [1m[35mDROP INDEX `name` ON `snippets`[0m
|
|
122
|
+
[1m[35m (3.8ms)[0m [1m[35mCREATE UNIQUE INDEX `name_site_id` ON `snippets` (`name`, `site_id`)[0m
|
|
123
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211077')[0m
|
|
124
|
+
Migrating to AddSiteIdToPages (20260420211078)
|
|
125
|
+
[1m[35m (7.9ms)[0m [1m[35mALTER TABLE `pages` ADD `site_id` int[0m
|
|
126
|
+
[1m[35m (3.0ms)[0m [1m[35mCREATE INDEX `index_pages_on_site_id` ON `pages` (`site_id`)[0m
|
|
127
|
+
[1m[36mSite Load (0.2ms)[0m [1m[34mSELECT `sites`.* FROM `sites` ORDER BY position ASC[0m
|
|
128
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.7ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211078')[0m
|
|
129
|
+
Migrating to AddBaseDomainToSites (20260420211079)
|
|
130
|
+
[1m[35m (10.7ms)[0m [1m[35mALTER TABLE `sites` ADD `base_domain` varchar(255)[0m
|
|
131
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211079')[0m
|
|
132
|
+
Migrating to CreateAssets (20260420211080)
|
|
133
|
+
[1m[35m (1.7ms)[0m [1m[35mCREATE TABLE `assets` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `caption` varchar(255), `title` varchar(255))[0m
|
|
134
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211080')[0m
|
|
135
|
+
Migrating to CreatePaperclipAttributes (20260420211081)
|
|
136
|
+
[1m[35m (8.9ms)[0m [1m[35mALTER TABLE `assets` ADD `asset_file_name` varchar(255)[0m
|
|
137
|
+
[1m[35m (4.0ms)[0m [1m[35mALTER TABLE `assets` ADD `asset_content_type` varchar(255)[0m
|
|
138
|
+
[1m[35m (3.6ms)[0m [1m[35mALTER TABLE `assets` ADD `asset_file_size` int[0m
|
|
139
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211081')[0m
|
|
140
|
+
Migrating to CreateUserObserver (20260420211082)
|
|
141
|
+
[1m[35m (6.6ms)[0m [1m[35mALTER TABLE `assets` ADD `created_by` int[0m
|
|
142
|
+
[1m[35m (7.2ms)[0m [1m[35mALTER TABLE `assets` ADD `updated_by` int[0m
|
|
143
|
+
[1m[35m (6.8ms)[0m [1m[35mALTER TABLE `assets` ADD `created_at` datetime[0m
|
|
144
|
+
[1m[35m (7.7ms)[0m [1m[35mALTER TABLE `assets` ADD `updated_at` datetime[0m
|
|
145
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211082')[0m
|
|
146
|
+
Migrating to CreatePageAttachments (20260420211083)
|
|
147
|
+
[1m[35m (4.2ms)[0m [1m[35mCREATE TABLE `page_attachments` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `asset_id` int, `page_id` int, `position` int)[0m
|
|
148
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211083')[0m
|
|
149
|
+
Migrating to RenameUsers (20260420211084)
|
|
150
|
+
[1m[35m (1.4ms)[0m [1m[35mALTER TABLE `assets` RENAME COLUMN `created_by` TO `created_by_id`[0m
|
|
151
|
+
[1m[35m (1.3ms)[0m [1m[35mALTER TABLE `assets` RENAME COLUMN `updated_by` TO `updated_by_id`[0m
|
|
152
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211084')[0m
|
|
153
|
+
Migrating to AddIndexes (20260420211085)
|
|
154
|
+
[1m[35m (2.3ms)[0m [1m[35mCREATE INDEX `pages_class_name` ON `pages` (`class_name`)[0m
|
|
155
|
+
[1m[35m (2.3ms)[0m [1m[35mCREATE INDEX `pages_parent_id` ON `pages` (`parent_id`)[0m
|
|
156
|
+
[1m[35m (2.0ms)[0m [1m[35mCREATE INDEX `pages_child_slug` ON `pages` (`slug`, `parent_id`)[0m
|
|
157
|
+
[1m[35m (1.8ms)[0m [1m[35mCREATE INDEX `pages_published` ON `pages` (`virtual`, `status_id`)[0m
|
|
158
|
+
[1m[35m (1.7ms)[0m [1m[35mCREATE INDEX `parts_by_page` ON `page_parts` (`page_id`, `name`)[0m
|
|
159
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211085')[0m
|
|
160
|
+
Migrating to AddUserLanguage (20260420211086)
|
|
161
|
+
[1m[35m (9.2ms)[0m [1m[35mALTER TABLE `users` ADD `language` varchar(255)[0m
|
|
162
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211086')[0m
|
|
163
|
+
Migrating to RenameDeveloperRoleToDesigner (20260420211087)
|
|
164
|
+
[1m[35m (2.3ms)[0m [1m[35mALTER TABLE `users` RENAME COLUMN `developer` TO `designer`[0m
|
|
165
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211087')[0m
|
|
166
|
+
Migrating to ChangeUserLanguageToLocale (20260420211088)
|
|
167
|
+
[1m[35m (2.7ms)[0m [1m[35mALTER TABLE `users` RENAME COLUMN `language` TO `locale`[0m
|
|
168
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211088')[0m
|
|
169
|
+
Migrating to AddPageFields (20260420211089)
|
|
170
|
+
[1m[35m (1.8ms)[0m [1m[35mCREATE TABLE `page_fields` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `page_id` int, `name` varchar(255), `content` varchar(255))[0m
|
|
171
|
+
[1m[35m (1.5ms)[0m [1m[35mCREATE INDEX `index_page_fields_on_page_id` ON `page_fields` (`page_id`)[0m
|
|
172
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.1ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211089')[0m
|
|
173
|
+
Migrating to ConvertPageMetas (20260420211090)
|
|
174
|
+
[1m[35m (23.7ms)[0m [1m[35mALTER TABLE `pages` DROP COLUMN `keywords`[0m
|
|
175
|
+
[1m[35m (150.1ms)[0m [1m[35mALTER TABLE `pages` DROP COLUMN `description`[0m
|
|
176
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.7ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211090')[0m
|
|
177
|
+
Migrating to AddFieldNameIndex (20260420211091)
|
|
178
|
+
[1m[35m (4.4ms)[0m [1m[35mDROP INDEX `index_page_fields_on_page_id` ON `page_fields`[0m
|
|
179
|
+
[1m[35m (7.0ms)[0m [1m[35mCREATE INDEX `index_page_fields_on_page_id_and_name_and_content` ON `page_fields` (`page_id`, `name`, `content`)[0m
|
|
180
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211091')[0m
|
|
181
|
+
Migrating to AssetUuid (20260420211092)
|
|
182
|
+
[1m[35m (12.8ms)[0m [1m[35mALTER TABLE `assets` ADD `uuid` varchar(255)[0m
|
|
183
|
+
[1m[36mAsset Load (0.4ms)[0m [1m[34mSELECT `assets`.* FROM `assets` ORDER BY created_at DESC[0m
|
|
184
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.5ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211092')[0m
|
|
185
|
+
Migrating to UpdateConfiguration (20260420211093)
|
|
186
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
187
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211093')[0m
|
|
188
|
+
Migrating to Dimensions (20260420211094)
|
|
189
|
+
[1m[35m (20.5ms)[0m [1m[35mALTER TABLE `assets` ADD `original_width` int[0m
|
|
190
|
+
[1m[35m (26.6ms)[0m [1m[35mALTER TABLE `assets` ADD `original_height` int[0m
|
|
191
|
+
[1m[35m (17.0ms)[0m [1m[35mALTER TABLE `assets` ADD `original_extension` varchar(255)[0m
|
|
192
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.5ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211094')[0m
|
|
193
|
+
Migrating to AddAllowedChildrenCacheToPages (20260420211095)
|
|
194
|
+
[1m[35m (45.2ms)[0m [1m[35mALTER TABLE `pages` ADD `allowed_children_cache` text[0m
|
|
195
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.2ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211095')[0m
|
|
196
|
+
Migrating to ExtendPagePartContentLimit (20260420211096)
|
|
197
|
+
[1m[35m (8.3ms)[0m [1m[35mALTER TABLE `page_parts` CHANGE `content` `content` mediumtext DEFAULT NULL[0m
|
|
198
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211096')[0m
|
|
199
|
+
Migrating to ChangePagesAllowedChildrenCacheToText (20260420211097)
|
|
200
|
+
[1m[35m (2.1ms)[0m [1m[35mALTER TABLE `pages` CHANGE `allowed_children_cache` `allowed_children_cache` text DEFAULT NULL[0m
|
|
201
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211097')[0m
|
|
202
|
+
Migrating to AddPasswordResetToUsers (20260420211098)
|
|
203
|
+
[1m[35m (6.4ms)[0m [1m[35mALTER TABLE `users` ADD `password_reset_token` varchar(255)[0m
|
|
204
|
+
[1m[35m (4.7ms)[0m [1m[35mALTER TABLE `users` ADD `password_reset_sent_at` datetime[0m
|
|
205
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211098')[0m
|
|
206
|
+
Migrating to AddPositionToPages (20260420211099)
|
|
207
|
+
[1m[35m (12.0ms)[0m [1m[35mALTER TABLE `pages` ADD `position` int[0m
|
|
208
|
+
[1m[36mPage Load (0.3ms)[0m [1m[34mSELECT `pages`.* FROM `pages` WHERE `pages`.`parent_id` IS NULL[0m
|
|
209
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211099')[0m
|
|
210
|
+
Migrating to CreateAdminUsers (20260420211100)
|
|
211
|
+
[1m[35m (6.9ms)[0m [1m[35mCREATE TABLE `admins` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `email` varchar(255) DEFAULT '' NOT NULL, `encrypted_password` varchar(255) DEFAULT '' NOT NULL, `reset_password_token` varchar(255), `reset_password_sent_at` datetime, `remember_created_at` datetime, `sign_in_count` int DEFAULT 0 NOT NULL, `current_sign_in_at` datetime, `last_sign_in_at` datetime, `current_sign_in_ip` varchar(255), `last_sign_in_ip` varchar(255), `confirmation_token` varchar(255), `confirmed_at` datetime, `confirmation_sent_at` datetime, `unconfirmed_email` varchar(255), `failed_attempts` int DEFAULT 0 NOT NULL, `unlock_token` varchar(255), `locked_at` datetime, `first_name` varchar(255), `last_name` varchar(255), `admin` tinyint(1), `designer` tinyint(1), `content_editor` tinyint(1), `site_id` int, `updated_by_id` int, `notes` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL)[0m
|
|
212
|
+
[1m[36mActiveRecord::SchemaMigration Create (1.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211100')[0m
|
|
213
|
+
Migrating to CreateActiveStorageTables (20260420211101)
|
|
214
|
+
[1m[35m (6.7ms)[0m [1m[35mCREATE TABLE `active_storage_blobs` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `key` varchar(255) NOT NULL, `filename` varchar(255) NOT NULL, `content_type` varchar(255), `metadata` text, `service_name` varchar(255) NOT NULL, `byte_size` bigint NOT NULL, `checksum` varchar(255) NOT NULL, `created_at` datetime NOT NULL, UNIQUE INDEX `index_active_storage_blobs_on_key` (`key`))[0m
|
|
215
|
+
[1m[35m (3.9ms)[0m [1m[35mCREATE TABLE `active_storage_attachments` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(255) NOT NULL, `record_type` varchar(255) NOT NULL, `record_id` bigint NOT NULL, `blob_id` bigint NOT NULL, `created_at` datetime NOT NULL, INDEX `index_active_storage_attachments_on_blob_id` (`blob_id`), UNIQUE INDEX `index_active_storage_attachments_uniqueness` (`record_type`, `record_id`, `name`, `blob_id`), CONSTRAINT `fk_rails_c3b3935057`
|
|
216
|
+
FOREIGN KEY (`blob_id`)
|
|
217
|
+
REFERENCES `active_storage_blobs` (`id`)
|
|
218
|
+
)[0m
|
|
219
|
+
[1m[35m (4.0ms)[0m [1m[35mCREATE TABLE `active_storage_variant_records` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `blob_id` bigint NOT NULL, `variation_digest` varchar(255) NOT NULL, UNIQUE INDEX `index_active_storage_variant_records_uniqueness` (`blob_id`, `variation_digest`), CONSTRAINT `fk_rails_993965df05`
|
|
220
|
+
FOREIGN KEY (`blob_id`)
|
|
221
|
+
REFERENCES `active_storage_blobs` (`id`)
|
|
222
|
+
)[0m
|
|
223
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211101')[0m
|
|
224
|
+
Migrating to CreateSiteUsers (20260420211102)
|
|
225
|
+
[1m[35m (4.7ms)[0m [1m[35mCREATE TABLE `admins_sites` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `admin_id` int NOT NULL, `site_id` int NOT NULL, INDEX `index_admins_sites_on_admin_id` (`admin_id`), INDEX `index_admins_sites_on_site_id` (`site_id`))[0m
|
|
226
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.7ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211102')[0m
|
|
227
|
+
Migrating to CreateVersions (20260420211103)
|
|
228
|
+
[1m[35m (4.8ms)[0m [1m[35mCREATE TABLE `versions` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `whodunnit` varchar(255), `created_at` datetime(6), `item_id` bigint NOT NULL, `item_type` varchar(191) NOT NULL, `event` varchar(255) NOT NULL, `object` longtext) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci[0m
|
|
229
|
+
[1m[35m (6.0ms)[0m [1m[35mCREATE INDEX `index_versions_on_item_type_and_item_id` ON `versions` (`item_type`, `item_id`)[0m
|
|
230
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211103')[0m
|
|
231
|
+
Migrating to CreateVersionAssociations (20260420211104)
|
|
232
|
+
[1m[35m (4.2ms)[0m [1m[35mCREATE TABLE `version_associations` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `version_id` int, `foreign_key_name` varchar(255) NOT NULL, `foreign_key_id` int, `foreign_type` varchar(255))[0m
|
|
233
|
+
[1m[35m (5.4ms)[0m [1m[35mCREATE INDEX `index_version_associations_on_version_id` ON `version_associations` (`version_id`)[0m
|
|
234
|
+
[1m[35m (2.8ms)[0m [1m[35mCREATE INDEX `index_version_associations_on_foreign_key` ON `version_associations` (`foreign_key_name`, `foreign_key_id`, `foreign_type`)[0m
|
|
235
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211104')[0m
|
|
236
|
+
Migrating to AddTransactionIdColumnToVersions (20260420211105)
|
|
237
|
+
[1m[35m (7.6ms)[0m [1m[35mALTER TABLE `versions` ADD `transaction_id` int[0m
|
|
238
|
+
[1m[35m (2.4ms)[0m [1m[35mCREATE INDEX `index_versions_on_transaction_id` ON `versions` (`transaction_id`)[0m
|
|
239
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211105')[0m
|
|
240
|
+
Migrating to AddDeviseTwoFactorToAdmins (20260420211106)
|
|
241
|
+
[1m[35m (6.8ms)[0m [1m[35mALTER TABLE `admins` ADD `otp_secret` varchar(255)[0m
|
|
242
|
+
[1m[35m (5.8ms)[0m [1m[35mALTER TABLE `admins` ADD `consumed_timestep` int[0m
|
|
243
|
+
[1m[35m (13.6ms)[0m [1m[35mALTER TABLE `admins` ADD `otp_required_for_login` tinyint(1)[0m
|
|
244
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211106')[0m
|
|
245
|
+
Migrating to AddObjectChangesToVersions (20260420211107)
|
|
246
|
+
[1m[35m (7.7ms)[0m [1m[35mALTER TABLE `versions` ADD `object_changes` longtext[0m
|
|
247
|
+
[1m[36mActiveRecord::SchemaMigration Create (0.5ms)[0m [1m[32mINSERT INTO `schema_migrations` (`version`) VALUES ('20260420211107')[0m
|
|
248
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT RELEASE_LOCK('6658685849647950510')[0m
|
|
249
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC[0m
|
|
250
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'admin.title' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
251
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
252
|
+
[1m[36mTrustyCms::Config Create (2.1ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('admin.title', 'TrustyCms CMS')[0m
|
|
253
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
254
|
+
[1m[36mTRANSACTION (7.1ms)[0m [1m[35mCOMMIT[0m
|
|
255
|
+
[1m[36mTrustyCms::Config Load (0.3ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'defaults.page.parts' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
256
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
257
|
+
[1m[36mTrustyCms::Config Create (0.1ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('defaults.page.parts', 'Body,Extended')[0m
|
|
258
|
+
[1m[36mTrustyCms::Config Load (0.0ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
259
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mCOMMIT[0m
|
|
260
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'defaults.page.status' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
261
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
262
|
+
[1m[36mTrustyCms::Config Create (0.1ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('defaults.page.status', 'Draft')[0m
|
|
263
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
264
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mCOMMIT[0m
|
|
265
|
+
[1m[36mTrustyCms::Config Load (0.0ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'pagination.param_name' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
266
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
267
|
+
[1m[36mTrustyCms::Config Create (0.1ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('pagination.param_name', 'page')[0m
|
|
268
|
+
[1m[36mTrustyCms::Config Load (0.0ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
269
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mCOMMIT[0m
|
|
270
|
+
[1m[36mTrustyCms::Config Load (0.0ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'pagination.per_page_param_name' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
271
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
272
|
+
[1m[36mTrustyCms::Config Create (0.1ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('pagination.per_page_param_name', 'per_page')[0m
|
|
273
|
+
[1m[36mTrustyCms::Config Load (0.0ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
274
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mCOMMIT[0m
|
|
275
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'admin.pagination.per_page' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
276
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
277
|
+
[1m[36mTrustyCms::Config Create (0.4ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('admin.pagination.per_page', '50')[0m
|
|
278
|
+
[1m[36mTrustyCms::Config Load (0.0ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
279
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mCOMMIT[0m
|
|
280
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'site.title' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
281
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
282
|
+
[1m[36mTrustyCms::Config Create (0.1ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('site.title', 'Your site title')[0m
|
|
283
|
+
[1m[36mTrustyCms::Config Load (0.0ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
284
|
+
[1m[36mTRANSACTION (0.2ms)[0m [1m[35mCOMMIT[0m
|
|
285
|
+
[1m[36mTrustyCms::Config Load (0.0ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'site.host' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
286
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
287
|
+
[1m[36mTrustyCms::Config Create (0.1ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('site.host', 'www.example.com')[0m
|
|
288
|
+
[1m[36mTrustyCms::Config Load (0.0ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
289
|
+
[1m[36mTRANSACTION (0.3ms)[0m [1m[35mCOMMIT[0m
|
|
290
|
+
[1m[36mTrustyCms::Config Load (0.2ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'session_timeout' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
291
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mBEGIN[0m
|
|
292
|
+
[1m[36mTrustyCms::Config Create (0.5ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('session_timeout', '1209600')[0m
|
|
293
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
294
|
+
[1m[36mTRANSACTION (1.3ms)[0m [1m[35mCOMMIT[0m
|
|
295
|
+
[1m[36mTrustyCms::Config Load (1.2ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'assets.create_image_thumbnails?' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
296
|
+
[1m[36mTRANSACTION (0.4ms)[0m [1m[35mBEGIN[0m
|
|
297
|
+
[1m[36mTrustyCms::Config Create (1.2ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('assets.create_image_thumbnails?', 'true')[0m
|
|
298
|
+
[1m[36mTrustyCms::Config Load (5.6ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
299
|
+
[1m[36mTRANSACTION (0.3ms)[0m [1m[35mCOMMIT[0m
|
|
300
|
+
[1m[36mTrustyCms::Config Load (0.2ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'assets.create_video_thumbnails?' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
301
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mBEGIN[0m
|
|
302
|
+
[1m[36mTrustyCms::Config Create (0.6ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('assets.create_video_thumbnails?', 'true')[0m
|
|
303
|
+
[1m[36mTrustyCms::Config Load (0.2ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
304
|
+
[1m[36mTRANSACTION (0.9ms)[0m [1m[35mCOMMIT[0m
|
|
305
|
+
[1m[36mTrustyCms::Config Load (0.5ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'assets.create_pdf_thumbnails?' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
306
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
307
|
+
[1m[36mTrustyCms::Config Create (0.2ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('assets.create_pdf_thumbnails?', 'true')[0m
|
|
308
|
+
[1m[36mTrustyCms::Config Load (0.3ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
309
|
+
[1m[36mTRANSACTION (0.6ms)[0m [1m[35mCOMMIT[0m
|
|
310
|
+
[1m[36mTrustyCms::Config Load (0.5ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'assets.thumbnails.image' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
311
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mBEGIN[0m
|
|
312
|
+
[1m[36mTrustyCms::Config Create (0.2ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('assets.thumbnails.image', 'normal:size=640x640>|small:size=320x320>')[0m
|
|
313
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
314
|
+
[1m[36mTRANSACTION (0.5ms)[0m [1m[35mCOMMIT[0m
|
|
315
|
+
[1m[36mTrustyCms::Config Load (0.2ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'assets.thumbnails.video' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
316
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
317
|
+
[1m[36mTrustyCms::Config Create (0.2ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('assets.thumbnails.video', 'normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg')[0m
|
|
318
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
319
|
+
[1m[36mTRANSACTION (0.4ms)[0m [1m[35mCOMMIT[0m
|
|
320
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'assets.thumbnails.pdf' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
321
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mBEGIN[0m
|
|
322
|
+
[1m[36mTrustyCms::Config Create (0.2ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('assets.thumbnails.pdf', 'normal:size=640x640>,format=jpg|small:size=320x320>,format=jpg')[0m
|
|
323
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
324
|
+
[1m[36mTRANSACTION (0.2ms)[0m [1m[35mCOMMIT[0m
|
|
325
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'assets.max_asset_size' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
326
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
327
|
+
[1m[36mTrustyCms::Config Create (0.1ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('assets.max_asset_size', '10')[0m
|
|
328
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
329
|
+
[1m[36mTRANSACTION (0.2ms)[0m [1m[35mCOMMIT[0m
|
|
330
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'assets.max_video_size' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
331
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
332
|
+
[1m[36mTrustyCms::Config Create (0.2ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('assets.max_video_size', '50')[0m
|
|
333
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
334
|
+
[1m[36mTRANSACTION (0.2ms)[0m [1m[35mCOMMIT[0m
|
|
335
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'assets.display_size' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
336
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
337
|
+
[1m[36mTrustyCms::Config Create (0.1ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('assets.display_size', 'normal')[0m
|
|
338
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
339
|
+
[1m[36mTRANSACTION (0.2ms)[0m [1m[35mCOMMIT[0m
|
|
340
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config` WHERE `config`.`key` = 'assets.insertion_size' ORDER BY `config`.`id` ASC LIMIT 1[0m
|
|
341
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[35mBEGIN[0m
|
|
342
|
+
[1m[36mTrustyCms::Config Create (0.1ms)[0m [1m[32mINSERT INTO `config` (`key`, `value`) VALUES ('assets.insertion_size', 'normal')[0m
|
|
343
|
+
[1m[36mTrustyCms::Config Load (0.1ms)[0m [1m[34mSELECT `config`.* FROM `config`[0m
|
|
344
|
+
[1m[36mTRANSACTION (0.3ms)[0m [1m[35mCOMMIT[0m
|
|
345
|
+
[1m[35m (1.0ms)[0m [1m[34mSELECT DISTINCT class_name FROM pages WHERE class_name <> '' AND class_name IS NOT NULL[0m
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1d9926ca1af1965414a2c8a3b0c301bcf1d26894000d2b3cc6a7b1c66edee3f4c759b8f792fdb3b3a8353464b39f53bfea2df3ea609a895b925602442d84a58a
|
|
File without changes
|
data/spec/models/asset_spec.rb
CHANGED
|
@@ -11,30 +11,84 @@ RSpec.describe Asset, type: :model do
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
describe 'validations' do
|
|
14
|
+
before do
|
|
15
|
+
AssetType.new :image, icon: 'image', styles: :standard, extensions: %w[jpg jpeg png gif], mime_types: %w[image/png image/x-png image/jpeg image/pjpeg image/jpg image/gif] unless AssetType.known?(:image)
|
|
16
|
+
AssetType.new :video, icon: 'video', mime_types: %w[video/mp4 video/mpeg video/quicktime video/webm] unless AssetType.known?(:video)
|
|
17
|
+
AssetType.new :document, icon: 'document', mime_types: %w[application/msword application/rtf text/plain text/html] unless AssetType.known?(:document)
|
|
18
|
+
end
|
|
19
|
+
|
|
14
20
|
it 'is valid when the content type is approved' do
|
|
15
|
-
asset = described_class.new(asset: upload_fixture('sample.
|
|
21
|
+
asset = described_class.new(asset: upload_fixture('sample.txt', 'text/plain'))
|
|
16
22
|
|
|
17
23
|
expect(asset).to be_valid
|
|
18
24
|
end
|
|
19
25
|
|
|
20
26
|
it 'is invalid when the content type is not approved' do
|
|
21
|
-
asset = described_class.new(asset: upload_fixture('sample.txt', '
|
|
27
|
+
asset = described_class.new(asset: upload_fixture('sample.txt', 'application/x-unsupported'))
|
|
22
28
|
|
|
23
29
|
expect(asset).not_to be_valid
|
|
24
|
-
expect(asset.errors[:asset]).to include(a_string_matching(/file
|
|
30
|
+
expect(asset.errors[:asset]).to include(a_string_matching(/file type/i))
|
|
25
31
|
end
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
context 'with stubbed size limits (1 MB asset / 2 MB video)' do
|
|
34
|
+
before do
|
|
35
|
+
allow(TrustyCms.config).to receive(:[]).and_call_original
|
|
36
|
+
allow(TrustyCms.config).to receive(:[]).with('assets.max_asset_size').and_return('1')
|
|
37
|
+
allow(TrustyCms.config).to receive(:[]).with('assets.max_video_size').and_return('2')
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it 'is invalid when a non-video file exceeds the maximum asset size' do
|
|
41
|
+
Tempfile.open(['large', '.png']) do |tempfile|
|
|
42
|
+
tempfile.binmode
|
|
43
|
+
tempfile.write('0' * (1.megabyte + 1))
|
|
44
|
+
tempfile.rewind
|
|
32
45
|
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
uploaded = Rack::Test::UploadedFile.new(tempfile.path, 'image/png')
|
|
47
|
+
asset = described_class.new(asset: uploaded)
|
|
35
48
|
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
expect(asset).not_to be_valid
|
|
50
|
+
expect(asset.errors[:asset]).to include(a_string_matching(/1 MB/))
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
it 'is invalid when a video file exceeds the maximum video size' do
|
|
55
|
+
Tempfile.open(['large', '.mp4']) do |tempfile|
|
|
56
|
+
tempfile.binmode
|
|
57
|
+
tempfile.write('0' * (2.megabytes + 1))
|
|
58
|
+
tempfile.rewind
|
|
59
|
+
|
|
60
|
+
uploaded = Rack::Test::UploadedFile.new(tempfile.path, 'video/mp4')
|
|
61
|
+
asset = described_class.new(asset: uploaded)
|
|
62
|
+
|
|
63
|
+
expect(asset).not_to be_valid
|
|
64
|
+
expect(asset.errors[:asset]).to include(a_string_matching(/2 MB/))
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
it 'allows a video file that exceeds the asset size limit but is within the video size limit' do
|
|
69
|
+
Tempfile.open(['video', '.mp4']) do |tempfile|
|
|
70
|
+
tempfile.binmode
|
|
71
|
+
tempfile.write('0' * (1.megabyte + 1.kilobyte))
|
|
72
|
+
tempfile.rewind
|
|
73
|
+
|
|
74
|
+
uploaded = Rack::Test::UploadedFile.new(tempfile.path, 'video/mp4')
|
|
75
|
+
asset = described_class.new(asset: uploaded)
|
|
76
|
+
|
|
77
|
+
expect(asset).to be_valid
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
it 'allows a video file within the maximum video size' do
|
|
82
|
+
Tempfile.open(['video', '.mp4']) do |tempfile|
|
|
83
|
+
tempfile.binmode
|
|
84
|
+
tempfile.write('0' * 1.kilobyte)
|
|
85
|
+
tempfile.rewind
|
|
86
|
+
|
|
87
|
+
uploaded = Rack::Test::UploadedFile.new(tempfile.path, 'video/mp4')
|
|
88
|
+
asset = described_class.new(asset: uploaded)
|
|
89
|
+
|
|
90
|
+
expect(asset).to be_valid
|
|
91
|
+
end
|
|
38
92
|
end
|
|
39
93
|
end
|
|
40
94
|
end
|
|
@@ -101,5 +155,108 @@ RSpec.describe Asset, type: :model do
|
|
|
101
155
|
|
|
102
156
|
expect(asset.thumbnail('thumbnail')).to eq('/rails/active_storage/variant/test')
|
|
103
157
|
end
|
|
158
|
+
|
|
159
|
+
it 'returns the direct asset url for pdfs without variant processing' do
|
|
160
|
+
asset = described_class.new(caption: '')
|
|
161
|
+
allow(asset).to receive_message_chain(:asset, :attached?).and_return(true)
|
|
162
|
+
allow(asset).to receive(:content_type).and_return('application/pdf')
|
|
163
|
+
allow(asset).to receive_message_chain(:asset, :url).and_return('https://s3.amazonaws.com/bucket/myprefix/system/assets/20260501/doc-abc123.pdf')
|
|
164
|
+
allow(asset).to receive(:rewrite_cloud_url) { |url| url }
|
|
165
|
+
|
|
166
|
+
expect(asset).not_to receive(:asset_variant)
|
|
167
|
+
expect(asset.thumbnail('normal')).to eq('https://s3.amazonaws.com/bucket/myprefix/system/assets/20260501/doc-abc123.pdf')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
it 'returns the asset type icon when nothing is attached' do
|
|
171
|
+
asset = described_class.new(caption: '')
|
|
172
|
+
allow(asset).to receive_message_chain(:asset, :attached?).and_return(false)
|
|
173
|
+
allow(asset).to receive(:asset_variant).and_return(nil)
|
|
174
|
+
allow(asset).to receive_message_chain(:asset_type, :icon).with('normal').and_return('/assets/admin/image_icon.png')
|
|
175
|
+
|
|
176
|
+
expect(asset.thumbnail('normal')).to eq('/assets/admin/image_icon.png')
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
describe '#render_original' do
|
|
181
|
+
it 'returns true for any style when the asset key starts with the configured prefix' do
|
|
182
|
+
asset = described_class.new
|
|
183
|
+
allow(TrustyCms::Config).to receive(:[]).with('assets.storage.prefix').and_return('myprefix')
|
|
184
|
+
allow(asset).to receive_message_chain(:asset, :attached?).and_return(true)
|
|
185
|
+
allow(asset).to receive_message_chain(:asset, :key).and_return('myprefix/system/assets/20260501/image-abc123.jpg')
|
|
186
|
+
|
|
187
|
+
expect(asset.render_original('normal')).to be(true)
|
|
188
|
+
expect(asset.render_original('thumbnail')).to be(true)
|
|
189
|
+
expect(asset.render_original('original')).to be(true)
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
it 'returns true when no prefix is configured but the key contains a path separator' do
|
|
193
|
+
asset = described_class.new
|
|
194
|
+
allow(TrustyCms::Config).to receive(:[]).with('assets.storage.prefix').and_return(nil)
|
|
195
|
+
allow(asset).to receive_message_chain(:asset, :attached?).and_return(true)
|
|
196
|
+
allow(asset).to receive_message_chain(:asset, :key).and_return('system/assets/20260501/image-abc123.jpg')
|
|
197
|
+
|
|
198
|
+
expect(asset.render_original('normal')).to be(true)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
it 'returns false when the key does not start with the configured prefix' do
|
|
202
|
+
asset = described_class.new
|
|
203
|
+
allow(TrustyCms::Config).to receive(:[]).with('assets.storage.prefix').and_return('myprefix')
|
|
204
|
+
allow(asset).to receive_message_chain(:asset, :attached?).and_return(true)
|
|
205
|
+
allow(asset).to receive_message_chain(:asset, :key).and_return('randomlegacykey')
|
|
206
|
+
|
|
207
|
+
expect(asset.render_original('normal')).to be(false)
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
it 'returns false when no asset is attached' do
|
|
211
|
+
asset = described_class.new
|
|
212
|
+
allow(asset).to receive_message_chain(:asset, :attached?).and_return(false)
|
|
213
|
+
|
|
214
|
+
expect(asset.render_original('normal')).to be(false)
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
describe '#public_url' do
|
|
219
|
+
let(:original_url) { 'https://s3.amazonaws.com/bucket/myprefix/system/assets/20260501/image-abc123.jpg' }
|
|
220
|
+
let(:variant_url) { 'https://s3.amazonaws.com/bucket/variants/abc/xyz.jpg' }
|
|
221
|
+
|
|
222
|
+
it 'returns the original url for new-style assets regardless of style' do
|
|
223
|
+
asset = described_class.new
|
|
224
|
+
allow(asset).to receive(:render_original).and_return(true)
|
|
225
|
+
allow(asset).to receive_message_chain(:asset, :url).and_return(original_url)
|
|
226
|
+
allow(asset).to receive(:rewrite_cloud_url) { |url| url }
|
|
227
|
+
|
|
228
|
+
expect(asset.public_url('normal')).to eq(original_url)
|
|
229
|
+
expect(asset.public_url('thumbnail')).to eq(original_url)
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
it 'returns the original url when style_name is original' do
|
|
233
|
+
asset = described_class.new
|
|
234
|
+
allow(asset).to receive(:render_original).and_return(false)
|
|
235
|
+
allow(asset).to receive_message_chain(:asset, :url).and_return(original_url)
|
|
236
|
+
allow(asset).to receive(:rewrite_cloud_url) { |url| url }
|
|
237
|
+
|
|
238
|
+
expect(asset.public_url('original')).to eq(original_url)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
it 'returns a variant url for old-style assets' do
|
|
242
|
+
asset = described_class.new
|
|
243
|
+
allow(asset).to receive(:render_original).and_return(false)
|
|
244
|
+
processed = instance_double(ActiveStorage::Variant, url: variant_url)
|
|
245
|
+
variant = instance_double(ActiveStorage::Variant, processed: processed)
|
|
246
|
+
allow(asset).to receive(:asset_variant).and_return(variant)
|
|
247
|
+
allow(asset).to receive(:rewrite_cloud_url) { |url| url }
|
|
248
|
+
|
|
249
|
+
expect(asset.public_url('normal')).to eq(variant_url)
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
it 'falls back to the asset url when no variant exists for an old-style asset' do
|
|
253
|
+
asset = described_class.new
|
|
254
|
+
allow(asset).to receive(:render_original).and_return(false)
|
|
255
|
+
allow(asset).to receive(:asset_variant).and_return(nil)
|
|
256
|
+
allow(asset).to receive_message_chain(:asset, :url).and_return('https://s3.amazonaws.com/bucket/randomlegacykey')
|
|
257
|
+
allow(asset).to receive(:rewrite_cloud_url) { |url| url }
|
|
258
|
+
|
|
259
|
+
expect(asset.public_url('normal')).to eq('https://s3.amazonaws.com/bucket/randomlegacykey')
|
|
260
|
+
end
|
|
104
261
|
end
|
|
105
262
|
end
|
data/trusty_cms.gemspec
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
require File.expand_path(__FILE__ + '/../lib/trusty_cms/version.rb')
|
|
5
5
|
Gem::Specification.new do |s|
|
|
6
|
-
s.required_ruby_version = '>= 3.
|
|
6
|
+
s.required_ruby_version = '>= 3.3.4'
|
|
7
7
|
s.name = 'trusty-cms'
|
|
8
8
|
s.version = TrustyCms::VERSION
|
|
9
9
|
s.platform = Gem::Platform::RUBY
|
|
@@ -9,11 +9,10 @@ class ClippedExtension < TrustyCms::Extension
|
|
|
9
9
|
TrustyCms::AdminUI.send :include, ClippedAdminUI unless defined? admin.asset # defines shards for extension of the asset-admin interface
|
|
10
10
|
Admin::PagesController.send :helper, Admin::AssetsHelper # currently only provides a description of asset sizes
|
|
11
11
|
Page.send :include, AssetTags # radius tags for selecting sets of assets and presenting each one
|
|
12
|
-
AssetType.new :image, :icon => 'image', :default_radius_tag => 'image', :styles => :standard, :extensions => %w[jpg jpeg png gif], :mime_types => %w[image/png image/x-png image/jpeg image/pjpeg image/jpg image/gif]
|
|
13
|
-
AssetType.new :video, :icon => 'video', :styles => :standard, :mime_types => %w[
|
|
14
|
-
AssetType.new :audio, :icon => 'audio', :mime_types => %w[audio/mpeg audio/mpg audio/ogg
|
|
12
|
+
AssetType.new :image, :icon => 'image', :default_radius_tag => 'image', :styles => :standard, :extensions => %w[jpg jpeg png gif webp avif], :mime_types => %w[image/png image/x-png image/jpeg image/pjpeg image/jpg image/gif image/webp image/avif]
|
|
13
|
+
AssetType.new :video, :icon => 'video', :styles => :standard, :mime_types => %w[video/mp4 video/webm video/quicktime video/mpeg video/ogg video/mp2t application/x-mp4]
|
|
14
|
+
AssetType.new :audio, :icon => 'audio', :mime_types => %w[audio/mpeg audio/mpg audio/ogg audio/mp4 audio/wav audio/x-wav application/ogg audio/flac]
|
|
15
15
|
AssetType.new :pdf, :icon => 'pdf', :extensions => %w{pdf}, :mime_types => %w[application/pdf application/x-pdf], :styles => :standard
|
|
16
|
-
AssetType.new :document, :icon => 'document', :mime_types => %w[application/msword application/rtf application/vnd.ms-excel application/vnd.ms-powerpoint application/vnd.ms-project application/vnd.ms-works text/plain text/html]
|
|
17
16
|
AssetType.new :other, :icon => 'unknown'
|
|
18
17
|
|
|
19
18
|
admin.asset ||= TrustyCms::AdminUI.load_default_asset_regions # loads the shards defined in AssetsAdminUI
|
|
@@ -3,7 +3,8 @@ TrustyCms.config do |config|
|
|
|
3
3
|
# Uncomment and change the settings below to customize the Clipped extension
|
|
4
4
|
|
|
5
5
|
# The default settings
|
|
6
|
-
# config["assets.max_asset_size"] =
|
|
6
|
+
# config["assets.max_asset_size"] = 10 # megabytes
|
|
7
|
+
# config["assets.max_video_size"] = 50 # megabytes
|
|
7
8
|
# config["assets.display_size"] = "normal"
|
|
8
9
|
# config["assets.insertion_size"] = "normal"
|
|
9
10
|
# config["assets.create_image_thumbnails?"] = true
|
data/yarn.lock
CHANGED
|
@@ -1735,9 +1735,9 @@ flat-cache@^3.0.4:
|
|
|
1735
1735
|
rimraf "^3.0.2"
|
|
1736
1736
|
|
|
1737
1737
|
flatted@^3.2.9:
|
|
1738
|
-
version "3.
|
|
1739
|
-
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.
|
|
1740
|
-
integrity sha512-
|
|
1738
|
+
version "3.4.2"
|
|
1739
|
+
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.4.2.tgz#f5c23c107f0f37de8dbdf24f13722b3b98d52726"
|
|
1740
|
+
integrity sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==
|
|
1741
1741
|
|
|
1742
1742
|
fs.realpath@^1.0.0:
|
|
1743
1743
|
version "1.0.0"
|
|
@@ -2262,9 +2262,9 @@ lodash.truncate@^4.4.2:
|
|
|
2262
2262
|
integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==
|
|
2263
2263
|
|
|
2264
2264
|
lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21:
|
|
2265
|
-
version "4.
|
|
2266
|
-
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.
|
|
2267
|
-
integrity sha512-
|
|
2265
|
+
version "4.18.1"
|
|
2266
|
+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.18.1.tgz#ff2b66c1f6326d59513de2407bf881439812771c"
|
|
2267
|
+
integrity sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==
|
|
2268
2268
|
|
|
2269
2269
|
log-symbols@^4.1.0:
|
|
2270
2270
|
version "4.1.0"
|
|
@@ -2961,9 +2961,9 @@ picocolors@^1.1.1:
|
|
|
2961
2961
|
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
|
|
2962
2962
|
|
|
2963
2963
|
picomatch@^2.3.1:
|
|
2964
|
-
version "2.3.
|
|
2965
|
-
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.
|
|
2966
|
-
integrity sha512-
|
|
2964
|
+
version "2.3.2"
|
|
2965
|
+
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.2.tgz#5a942915e26b372dc0f0e6753149a16e6b1c5601"
|
|
2966
|
+
integrity sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==
|
|
2967
2967
|
|
|
2968
2968
|
postcss-html@^0.36.0:
|
|
2969
2969
|
version "0.36.0"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trusty-cms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.1.
|
|
4
|
+
version: 7.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- TrustyCms CMS dev team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activestorage-validator
|
|
@@ -941,6 +941,7 @@ files:
|
|
|
941
941
|
- config/application.rb
|
|
942
942
|
- config/boot.rb
|
|
943
943
|
- config/database.mysql.yml
|
|
944
|
+
- config/database.yml
|
|
944
945
|
- config/environment.rb
|
|
945
946
|
- config/environments/development.rb
|
|
946
947
|
- config/environments/production.rb
|
|
@@ -1194,11 +1195,17 @@ files:
|
|
|
1194
1195
|
- spec/dummy/config/secrets.yml
|
|
1195
1196
|
- spec/dummy/config/storage.yml
|
|
1196
1197
|
- spec/dummy/db/schema.rb
|
|
1198
|
+
- spec/dummy/log/development.log
|
|
1199
|
+
- spec/dummy/log/test.log
|
|
1197
1200
|
- spec/dummy/package.json
|
|
1198
1201
|
- spec/dummy/public/404.html
|
|
1199
1202
|
- spec/dummy/public/422.html
|
|
1200
1203
|
- spec/dummy/public/500.html
|
|
1201
1204
|
- spec/dummy/public/favicon.ico
|
|
1205
|
+
- spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig
|
|
1206
|
+
- spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime
|
|
1207
|
+
- spec/dummy/tmp/local_secret.txt
|
|
1208
|
+
- spec/dummy/tmp/trusty_config_cache.txt
|
|
1202
1209
|
- spec/dummy/yarn.lock
|
|
1203
1210
|
- spec/factories/layout.rb
|
|
1204
1211
|
- spec/factories/page.rb
|
|
@@ -1305,14 +1312,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
1305
1312
|
requirements:
|
|
1306
1313
|
- - ">="
|
|
1307
1314
|
- !ruby/object:Gem::Version
|
|
1308
|
-
version: 3.
|
|
1315
|
+
version: 3.3.4
|
|
1309
1316
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1310
1317
|
requirements:
|
|
1311
1318
|
- - ">"
|
|
1312
1319
|
- !ruby/object:Gem::Version
|
|
1313
1320
|
version: 1.3.1
|
|
1314
1321
|
requirements: []
|
|
1315
|
-
rubygems_version: 3.
|
|
1322
|
+
rubygems_version: 3.5.11
|
|
1316
1323
|
signing_key:
|
|
1317
1324
|
specification_version: 4
|
|
1318
1325
|
summary: A no-fluff content management system designed for small teams.
|
|
@@ -1351,11 +1358,17 @@ test_files:
|
|
|
1351
1358
|
- spec/dummy/config/storage.yml
|
|
1352
1359
|
- spec/dummy/config.ru
|
|
1353
1360
|
- spec/dummy/db/schema.rb
|
|
1361
|
+
- spec/dummy/log/development.log
|
|
1362
|
+
- spec/dummy/log/test.log
|
|
1354
1363
|
- spec/dummy/package.json
|
|
1355
1364
|
- spec/dummy/public/404.html
|
|
1356
1365
|
- spec/dummy/public/422.html
|
|
1357
1366
|
- spec/dummy/public/500.html
|
|
1358
1367
|
- spec/dummy/public/favicon.ico
|
|
1368
|
+
- spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig
|
|
1369
|
+
- spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime
|
|
1370
|
+
- spec/dummy/tmp/local_secret.txt
|
|
1371
|
+
- spec/dummy/tmp/trusty_config_cache.txt
|
|
1359
1372
|
- spec/dummy/yarn.lock
|
|
1360
1373
|
- spec/factories/layout.rb
|
|
1361
1374
|
- spec/factories/page.rb
|