effective_storage 0.4.2 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fd5855eb03beb973377deab121f3a632fe8afc28999b802717ab8300c1bfb60
|
4
|
+
data.tar.gz: b519d27a7ad134900899897874b40bf6a10cf36b34c64a3836507731880a8ba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz: '
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0093a45fdfe5cabef645f11913770d36070ccc395dc6aa85b71a9aa0fb750e8319be4f752dc628f8e9379ebf229503c0b5cdcf2d5179fec304d86a0f3504041e'
|
7
|
+
data.tar.gz: 255295667680f5a9dd9b5c9a097ea06d4b7d93ea1e849ecd5fb84cf5966634b9ec844acc92ce0148683f3e1a04c29fa2d034e78f044ff1f1b3c8126492725290
|
@@ -56,6 +56,10 @@ module Admin
|
|
56
56
|
end.join.html_safe
|
57
57
|
end
|
58
58
|
|
59
|
+
col :bucket, visible: false do |blob|
|
60
|
+
blob.attachments.map { |attachment| attachment.name }.join.html_safe
|
61
|
+
end
|
62
|
+
|
59
63
|
col :filename, label: 'File' do |blob|
|
60
64
|
content_tag(:div, class: 'col-resource_item') do
|
61
65
|
link_to(blob.filename, url_for(blob), target: '_blank')
|
@@ -80,7 +84,15 @@ module Admin
|
|
80
84
|
end
|
81
85
|
|
82
86
|
collection do
|
83
|
-
ActiveStorage::Blob.all.deep.left_outer_joins(:attachments)
|
87
|
+
scope = ActiveStorage::Blob.all.deep.left_outer_joins(:attachments)
|
88
|
+
|
89
|
+
if attributes[:resource_id].present? && attributes[:resource_type].present?
|
90
|
+
attachments = ActiveStorage::Attachment.where(record_id: attributes[:resource_id], record_type: attributes[:resource_type])
|
91
|
+
scope = scope.where(id: attachments.select(:blob_id))
|
92
|
+
end
|
93
|
+
|
94
|
+
scope
|
95
|
+
|
84
96
|
end
|
85
97
|
|
86
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: haml
|
98
|
+
name: haml
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
- !ruby/object:Gem::Version
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
173
|
+
rubygems_version: 3.3.7
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Authorize and browse Active Storage attachments
|