effective_assets 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/effective_assets_helper.rb +1 -1
- data/app/models/effective/asset.rb +4 -2
- data/lib/effective_assets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c006f8da2100d57927ae98097485ec52f1106af8
|
4
|
+
data.tar.gz: 7617b72b67b27d90d0cfc8fe3be3d4abb6fda416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8176d543b54d8571828cd6343f71dae8883a43739eba4ec684b24e21a056e4896c020e9c9f448eda4569f98eab28ab5d8bb1c33e704eb21098160b4e2d2d2b7e
|
7
|
+
data.tar.gz: cc46a87b4664f146a0577502de55907d263cbad1ededa68bb031a273fcd53fdd6bcb095f7c3524ff702dda875302fb4a205ef0d2f945d58ffbd975a0657b0205
|
@@ -57,7 +57,7 @@ module EffectiveAssetsHelper
|
|
57
57
|
elsif asset.content_type.include? 'msword'
|
58
58
|
image_path('mime-types/word.jpg')
|
59
59
|
elsif asset.content_type.include? 'excel'
|
60
|
-
image_path('mime-types/excel.
|
60
|
+
image_path('mime-types/excel.jpg')
|
61
61
|
elsif asset.content_type.include? 'application/pdf'
|
62
62
|
image_path('mime-types/pdf.png')
|
63
63
|
elsif asset.content_type.include? 'application/zip'
|
@@ -133,7 +133,8 @@ module Effective
|
|
133
133
|
|
134
134
|
def public_url(version = nil)
|
135
135
|
if data.present?
|
136
|
-
version.present? ? data.send(version).file.url : data.file.url
|
136
|
+
url = (version.present? ? data.send(version).file.try(:url) : data.file.try(:url))
|
137
|
+
url || '#'
|
137
138
|
else
|
138
139
|
"#{Asset.s3_base_path.chomp('/')}/#{EffectiveAssets.aws_path.chomp('/')}/#{id.to_i}/#{file_name}"
|
139
140
|
end
|
@@ -141,7 +142,8 @@ module Effective
|
|
141
142
|
|
142
143
|
def authenticated_url(version = nil, expire_in = 60.minutes)
|
143
144
|
data.aws_authenticated_url_expiration = expire_in
|
144
|
-
version.present? ? data.send(version).file.authenticated_url : data.file.authenticated_url
|
145
|
+
url = (version.present? ? data.send(version).file.try(:authenticated_url) : data.file.try(:authenticated_url))
|
146
|
+
url || '#'
|
145
147
|
end
|
146
148
|
|
147
149
|
def file_name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
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: 2015-10-
|
11
|
+
date: 2015-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|