effective_assets 1.9.2 → 1.9.3

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
  SHA1:
3
- metadata.gz: 270d9c01d088e1274797ab996187bc92f77564c3
4
- data.tar.gz: 590af797beb1b2b7014ff636806d509038c2cebd
3
+ metadata.gz: de50de960170c291dc68a6ed080085e7fe94b7c3
4
+ data.tar.gz: 604c94ab2c3b532ee4cefe65dd4d74477c99d0cd
5
5
  SHA512:
6
- metadata.gz: 68913570e88a23c127f525cf1fc9a3ca0bd87aa329f98551592a6423ba3705ed87192e677537cc33eec0180c5c3f6431062a1076e60d01cc0b140bfd17572f33
7
- data.tar.gz: d6a316a1f9b3d314a79322eb47606fc10b40307657de82537643c00944c78530bda477a1a9101e425590aa885fb85bbf9842045758297382da1694b6ed80e3cc
6
+ metadata.gz: 5556bd6ec9b1d637b6a26e2e0d4570dcfd2b6500036cc674a977bd273a748b08b4b817597e986f164ad0d3c264cd4a57e9ec2306fad937c7eb5fcf1fb701ce38
7
+ data.tar.gz: 3c98e8f97e9fd3af581bd7587dde513455dc14851187131ada2486eb89188e2e1a366c3f33393e86a2e7bdeda6bdf860b89b0abc73431529bf8cdc3fef96d01c
@@ -14,9 +14,11 @@ module Effective
14
14
  if params[:only] == 'images'
15
15
  @assets = @assets.images
16
16
  @file_types = [:jpg, :gif, :png, :bmp, :ico]
17
+ @aws_acl = EffectiveAssets::AWS_PUBLIC
17
18
  elsif params[:only] == 'nonimages'
18
19
  @assets = @assets.nonimages
19
20
  @file_types = [:pdf, :zip, :doc, :docx, :xls, :xlsx, :txt, :csv, :avi, :m4v, :m2v, :mov, :mp3, :mp4, :eml]
21
+ @aws_acl = EffectiveAssets.aws_acl
20
22
  end
21
23
 
22
24
  @user_uploads = IframeUploads.new(@assets)
@@ -15,8 +15,16 @@ if defined?(EffectiveRegions)
15
15
  :span
16
16
  end
17
17
 
18
+ def private_url
19
+ super || aws_private?
20
+ end
21
+
18
22
  def is_private?
19
- private_url == true || (asset.try(:aws_acl) == EffectiveAssets::AWS_PRIVATE)
23
+ private_url == true
24
+ end
25
+
26
+ def aws_private?
27
+ (asset.try(:aws_acl) == EffectiveAssets::AWS_PRIVATE)
20
28
  end
21
29
 
22
30
  end
@@ -24,4 +24,4 @@
24
24
  attachment_actions: [:insert, :delete],
25
25
  attachment_add_to: :top,
26
26
  file_types: (@file_types || :any),
27
- aws_acl: EffectiveAssets::AWS_PUBLIC
27
+ aws_acl: (@aws_acl || EffectiveAssets.aws_acl)
@@ -1,3 +1,3 @@
1
1
  module EffectiveAssets
2
- VERSION = '1.9.2'.freeze
2
+ VERSION = '1.9.3'.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.9.2
4
+ version: 1.9.3
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: 2017-02-16 00:00:00.000000000 Z
11
+ date: 2017-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails