motor-admin 0.4.18 → 0.4.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/motor/active_storage_attachments_controller.rb +17 -3
- data/lib/motor/version.rb +1 -1
- data/ui/dist/{main-17b6af8c481786f31cc4.css.gz → main-7b8275fb2ab269bb5f11.css.gz} +0 -0
- data/ui/dist/main-7b8275fb2ab269bb5f11.js.gz +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +4 -4
- data/ui/dist/main-17b6af8c481786f31cc4.js.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b796ea06cac239bc9bbdb96dc4c55360f0ea1f10ef231138b97f45a12922110
|
4
|
+
data.tar.gz: 9178090c51a6b08d9a393e9c4b0f3c09733ac96ce9e9bce9c8fb07c1c0ed8c7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 545907a15250c164e46a1fdb9b9da76cfbaf181e1013521ebca2db73c38a63b4490e486929d064e7e5de4a05fa8ed4dfb3664bcd819cfd25af01adabc9b72045
|
7
|
+
data.tar.gz: 139ac86931034ee3f93826bd869eb2bb3f4a00c52d3e017875ac8ee512dda47cd8a8c892d703668b205dcd9f730e650041f60cc820d95376ddce024aa0584786
|
@@ -9,7 +9,13 @@ module Motor
|
|
9
9
|
load_and_authorize_resource :attachment, class: 'ActiveStorage::Attachment', parent: false
|
10
10
|
|
11
11
|
def create
|
12
|
-
|
12
|
+
blob = if file_params[:key]
|
13
|
+
ActiveStorage::Blob.create!(file_params)
|
14
|
+
else
|
15
|
+
ActiveStorage::Blob.create_and_upload!(file_params)
|
16
|
+
end
|
17
|
+
|
18
|
+
@attachment.assign_attributes(blob: blob, record: record)
|
13
19
|
@attachment.assign_attributes(record_type: '', record_id: 0) unless record
|
14
20
|
|
15
21
|
if @attachment.save(validate: false)
|
@@ -36,12 +42,20 @@ module Motor
|
|
36
42
|
end
|
37
43
|
|
38
44
|
def file_params
|
39
|
-
params.require(:data).require(:file).permit(:io, :filename
|
45
|
+
attrs = params.require(:data).require(:file).permit(:io, :filename, :key,
|
46
|
+
:checksum, :byte_size,
|
47
|
+
:content_type).to_h.symbolize_keys
|
48
|
+
|
49
|
+
return attrs if params.dig(:data, :file, :base64).blank?
|
50
|
+
|
51
|
+
attrs[:io] = StringIO.new(Base64.urlsafe_decode64(params[:data][:file][:base64]))
|
52
|
+
|
53
|
+
attrs
|
40
54
|
end
|
41
55
|
|
42
56
|
def attachment_params
|
43
57
|
if params[:data].present?
|
44
|
-
params.require(:data).except(:file).permit
|
58
|
+
params.require(:data).except(:file).permit(:name, :record_type, :record_id)
|
45
59
|
else
|
46
60
|
{}
|
47
61
|
end
|
data/lib/motor/version.rb
CHANGED
Binary file
|
Binary file
|
data/ui/dist/manifest.json
CHANGED
@@ -3964,9 +3964,9 @@
|
|
3964
3964
|
"images/layers-2x.png": "images/layers-2x.png",
|
3965
3965
|
"images/layers.png": "images/layers.png",
|
3966
3966
|
"images/marker-icon.png": "images/marker-icon.png",
|
3967
|
-
"main-
|
3968
|
-
"main-
|
3969
|
-
"main-
|
3970
|
-
"main.css": "main-
|
3971
|
-
"main.js": "main-
|
3967
|
+
"main-7b8275fb2ab269bb5f11.css.gz": "main-7b8275fb2ab269bb5f11.css.gz",
|
3968
|
+
"main-7b8275fb2ab269bb5f11.js.LICENSE.txt": "main-7b8275fb2ab269bb5f11.js.LICENSE.txt",
|
3969
|
+
"main-7b8275fb2ab269bb5f11.js.gz": "main-7b8275fb2ab269bb5f11.js.gz",
|
3970
|
+
"main.css": "main-7b8275fb2ab269bb5f11.css",
|
3971
|
+
"main.js": "main-7b8275fb2ab269bb5f11.js"
|
3972
3972
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motor-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Matsyburka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ar_lazy_preload
|
@@ -2235,8 +2235,8 @@ files:
|
|
2235
2235
|
- ui/dist/images/layers-2x.png
|
2236
2236
|
- ui/dist/images/layers.png
|
2237
2237
|
- ui/dist/images/marker-icon.png
|
2238
|
-
- ui/dist/main-
|
2239
|
-
- ui/dist/main-
|
2238
|
+
- ui/dist/main-7b8275fb2ab269bb5f11.css.gz
|
2239
|
+
- ui/dist/main-7b8275fb2ab269bb5f11.js.gz
|
2240
2240
|
- ui/dist/manifest.json
|
2241
2241
|
homepage:
|
2242
2242
|
licenses:
|
Binary file
|