motor-admin 0.4.17 → 0.4.19
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/app/controllers/motor/active_storage_attachments_controller.rb +17 -3
- data/lib/motor/admin.rb +1 -1
- data/lib/motor/version.rb +1 -1
- data/ui/dist/{main-17b6af8c481786f31cc4.css.gz → main-ef1da0e0e37f4ff4c0bd.css.gz} +0 -0
- data/ui/dist/main-ef1da0e0e37f4ff4c0bd.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: a88b2fd0cde6191cd9f88b1df8063d996e8532b309e290f0e963859fbc7faabd
|
4
|
+
data.tar.gz: fd40adb2042a35f79781fdc501563031da2d104dc40c87da49a11335083b98d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f7782f4087685b746e3c8974b5dcb60feeeb201b848e1816a017e4e825c6efb32170165647e85212346331daaff357e0ab00b68ff8e0aceebd85021ad2b9fd7
|
7
|
+
data.tar.gz: da3509a503cbcf673a4ee41c129f3bd51b7a4a6b4247f5c3f07aeabe0ef8ff92d068495d03469cbc29edc111d9f61f721260f8879be86a1002d51cdb4ab5efe9
|
@@ -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/admin.rb
CHANGED
@@ -4,7 +4,7 @@ module Motor
|
|
4
4
|
class Admin < ::Rails::Engine
|
5
5
|
config.custom_html = ''
|
6
6
|
|
7
|
-
if !Motor.development? &&
|
7
|
+
if !Motor.development? && Rails.env.development?
|
8
8
|
config.eager_load_paths.delete(File.expand_path('../../app/controllers', __dir__))
|
9
9
|
config.eager_load_paths.delete(File.expand_path('../../app/controllers/concerns', __dir__))
|
10
10
|
config.eager_load_paths.delete(File.expand_path('../../app/models', __dir__))
|
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-ef1da0e0e37f4ff4c0bd.css.gz": "main-ef1da0e0e37f4ff4c0bd.css.gz",
|
3968
|
+
"main-ef1da0e0e37f4ff4c0bd.js.LICENSE.txt": "main-ef1da0e0e37f4ff4c0bd.js.LICENSE.txt",
|
3969
|
+
"main-ef1da0e0e37f4ff4c0bd.js.gz": "main-ef1da0e0e37f4ff4c0bd.js.gz",
|
3970
|
+
"main.css": "main-ef1da0e0e37f4ff4c0bd.css",
|
3971
|
+
"main.js": "main-ef1da0e0e37f4ff4c0bd.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.19
|
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-06-17 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-ef1da0e0e37f4ff4c0bd.css.gz
|
2239
|
+
- ui/dist/main-ef1da0e0e37f4ff4c0bd.js.gz
|
2240
2240
|
- ui/dist/manifest.json
|
2241
2241
|
homepage:
|
2242
2242
|
licenses:
|
Binary file
|