effective_storage 0.2.2 → 0.3.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e291eec4a68519b15b3bd9364f6ee39f82efcfcdf5a50b9503716feb74685e60
|
|
4
|
+
data.tar.gz: febfb716cde67d02e88b9f2ec5d819a40a961ab2a467e76dd9201ddaec58562c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7ababb553f86b947c43c9b25ce0f7afcb6469477c1777c0f641e687f90b11da385a92f40859f02ec474b61324d23851f6a05695f53a7858f7079704c141cc7f
|
|
7
|
+
data.tar.gz: b99b47de7953cca44d41430184d0fc92b6520638674ed02096ee8e45d24676fe55c84d14ac8f8e6224ddf3a05b6e76d3a4b2facae078c3dad652c0791fbec24c
|
|
@@ -98,7 +98,10 @@ module ActiveStorageAuthorization
|
|
|
98
98
|
return true if blob.image?
|
|
99
99
|
|
|
100
100
|
# Require sign in to view any attached files
|
|
101
|
-
current_user.present?
|
|
101
|
+
# current_user.present?
|
|
102
|
+
|
|
103
|
+
# Let anyone view these files
|
|
104
|
+
true
|
|
102
105
|
end
|
|
103
106
|
|
|
104
107
|
# This was included and resized in an ActionText::RichText object
|
|
@@ -110,7 +113,8 @@ module ActiveStorageAuthorization
|
|
|
110
113
|
# This is a has_one_attached or has_many_attached record
|
|
111
114
|
# Or an ActionText::RichText object, that belongs_to a record
|
|
112
115
|
def authorized_attachment_download?(attachment)
|
|
113
|
-
|
|
116
|
+
# DO NOT USE .blank? or .present? here. They return incorrect values.
|
|
117
|
+
return false if attachment.record.nil?
|
|
114
118
|
|
|
115
119
|
# Associated Record
|
|
116
120
|
record = attachment.record
|
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
|
+
version: 0.3.1
|
|
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:
|
|
11
|
+
date: 2023-02-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|