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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c67c92237f6b56315688a9a7e3d99fda5003ae1a
4
- data.tar.gz: 4342c97db0a74f2e3154feeb24d7f5ed3024aed0
3
+ metadata.gz: c006f8da2100d57927ae98097485ec52f1106af8
4
+ data.tar.gz: 7617b72b67b27d90d0cfc8fe3be3d4abb6fda416
5
5
  SHA512:
6
- metadata.gz: 72ad719b4aca16a29444fb9fabed8c9fa32ae455aaee367678f0083b16f049c20b5c5ca7dd5349019ebd7d9fe7e287e03b7b40367af588f27c0ba5040a7b43d7
7
- data.tar.gz: 06128f78aa8bc3d1ba9201c8ddca3ae68bc034e3db7c6c8580ed9137a6a7a33104c6658e6ebca4f3d2f018752f25eecb0bc55d64dc736b587443082796e37661
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.png')
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveAssets
2
- VERSION = '1.5.1'.freeze
2
+ VERSION = '1.5.2'.freeze
3
3
  end
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.1
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-28 00:00:00.000000000 Z
11
+ date: 2015-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails