katalyst-koi 4.5.6 → 4.5.7
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: 13cd00ba07e90a830f3a858db1fdd1f22181bf68448b0716441b66c2ce17eb84
|
4
|
+
data.tar.gz: 96bbf769605e6b8b4091f500e475cdb033039e037b784c7469a9ce52ade9866c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8c065374fc75587b31288078435eb2e9ad801a3e1dbf19984868d4377f0e6cf31b8e992c9b2f7a0b6761669506087c08d742faebe31a79356d6fe869c67c921
|
7
|
+
data.tar.gz: b159be789bf941acab6882e460ccf85858b4a5016f10195d4351b2050eb33260ae1835e404a43cee3c763a68af4a1321d017e879a7fe56225d608a9e0a58b945
|
@@ -14,9 +14,9 @@ module Koi
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def representation
|
17
|
-
if
|
18
|
-
image_tag(
|
19
|
-
elsif
|
17
|
+
if raw_value.try(:variable?) && named_variant.present?
|
18
|
+
image_tag(raw_value.variant(@variant))
|
19
|
+
elsif raw_value.try(:attached?)
|
20
20
|
filename.to_s
|
21
21
|
else
|
22
22
|
""
|
@@ -24,7 +24,7 @@ module Koi
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def filename
|
27
|
-
|
27
|
+
raw_value.blob.filename
|
28
28
|
end
|
29
29
|
|
30
30
|
# Utility for accessing the path Rails provides for retrieving the
|
@@ -33,14 +33,14 @@ module Koi
|
|
33
33
|
# <%= link_to "Download", cell.internal_path %>
|
34
34
|
# <% end %>
|
35
35
|
def internal_path
|
36
|
-
rails_blob_path(
|
36
|
+
rails_blob_path(raw_value, disposition: :attachment)
|
37
37
|
end
|
38
38
|
|
39
39
|
private
|
40
40
|
|
41
41
|
# Find the reflective variant by name (i.e. :thumb by default)
|
42
42
|
def named_variant
|
43
|
-
|
43
|
+
@model.attachment_reflections[@attribute.to_s].named_variants[@variant.to_sym]
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -220,7 +220,7 @@ module Koi
|
|
220
220
|
|
221
221
|
# Find the reflective variant by name (i.e. :thumb by default)
|
222
222
|
def named_variant
|
223
|
-
|
223
|
+
object.attachment_reflections[@attribute.to_s].named_variants[@variant.to_sym]
|
224
224
|
end
|
225
225
|
end
|
226
226
|
end
|