Class: EffectiveAssetsUploader

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Includes:
CarrierWave::MiniMagick
Defined in:
app/uploaders/effective_assets_uploader.rb

Direct Known Subclasses

AssetUploader, TestAssetUploader

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.image?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'app/uploaders/effective_assets_uploader.rb', line 36

def self.image?
  proc { |uploader| (uploader.model.image? rescue false) }
end

Instance Method Details

#aws_aclObject



28
29
30
# File 'app/uploaders/effective_assets_uploader.rb', line 28

def aws_acl
  model.aws_acl
end

#aws_authenticated_url_expirationObject



20
21
22
# File 'app/uploaders/effective_assets_uploader.rb', line 20

def aws_authenticated_url_expiration
  @aws_authenticated_url_expiration || 10.minutes.to_i
end

#aws_authenticated_url_expiration=(expires_in) ⇒ Object



24
25
26
# File 'app/uploaders/effective_assets_uploader.rb', line 24

def aws_authenticated_url_expiration=(expires_in)
  @aws_authenticated_url_expiration = expires_in
end

#aws_publicObject



16
17
18
# File 'app/uploaders/effective_assets_uploader.rb', line 16

def aws_public
  model.aws_acl == EffectiveAssets::AWS_PUBLIC rescue true
end

#aws_write_optionsObject



32
33
34
# File 'app/uploaders/effective_assets_uploader.rb', line 32

def aws_write_options
  { acl: aws_acl }
end

#store_dirObject



6
7
8
# File 'app/uploaders/effective_assets_uploader.rb', line 6

def store_dir
  "#{EffectiveAssets.aws_path.chomp('/')}/#{model.id.to_i}"
end

#versions_infoObject

Returns a Hash as per the versions above :height=>70, :full_page=>:height=>nil}



12
13
14
# File 'app/uploaders/effective_assets_uploader.rb', line 12

def versions_info
  @versions_info ||= calculate_versions_info
end