effective_assets 1.3.2 → 1.4.0
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 +2 -4
- data/app/models/effective/asset.rb +0 -3
- data/app/views/active_admin/effective_assets/_edit.html.haml +0 -2
- data/db/migrate/01_create_effective_assets.rb.erb +0 -2
- data/lib/effective_assets/version.rb +1 -1
- data/spec/internal/db/schema.rb +0 -2
- data/spec/models/asset_spec.rb +1 -3
- 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: 1b649c6f9b41d38fc33afb6d544d9647d3c715c9
|
4
|
+
data.tar.gz: dad8ac898260ea9affff90c095630fe03e6b1bef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47eb0c923377ea585157f6e4ec8b3ceb2bdec2f8bb651d8bc5d72759629b5c96f173e6b2a6ca3cb7108a236cb0003da5c9b1042dc950872fd95fc4e294b9052b
|
7
|
+
data.tar.gz: 620ef92e842acfe34937d4cf2410b59d676af875e82d3d4299bc8981213c813ed479bc45cfd4a83dc8907ab47a35198e9a6c7945d46889f3a74ac1835587f41a
|
@@ -13,14 +13,14 @@ module EffectiveAssetsHelper
|
|
13
13
|
opts = {}
|
14
14
|
end
|
15
15
|
|
16
|
-
opts = opts.merge({:alt => asset.
|
16
|
+
opts = opts.merge({:alt => asset.title || asset.file_name}).merge(options)
|
17
17
|
|
18
18
|
content_tag(:img, nil, opts.merge(:src => _effective_asset_image_url(asset, version))).gsub('"', "'").html_safe
|
19
19
|
end
|
20
20
|
|
21
21
|
def effective_asset_link_to(asset, version = nil, options = {})
|
22
22
|
options_title = options.delete(:title)
|
23
|
-
link_title = options_title || asset.title || asset.file_name ||
|
23
|
+
link_title = options_title || asset.title || asset.file_name || "Asset ##{asset.id}"
|
24
24
|
|
25
25
|
if asset.image?
|
26
26
|
link_to(link_title, _effective_asset_image_url(asset, version), options).gsub('"', "'").html_safe # we need all ' quotes or it breaks Insert as functionality
|
@@ -36,8 +36,6 @@ module EffectiveAssetsHelper
|
|
36
36
|
def effective_asset_title(asset)
|
37
37
|
[
|
38
38
|
asset.title,
|
39
|
-
asset.description,
|
40
|
-
asset.tags,
|
41
39
|
"Size: #{number_to_human_size(asset.data_size)}",
|
42
40
|
"Content Type: #{asset.content_type}"
|
43
41
|
].compact.join("\n")
|
@@ -9,8 +9,6 @@
|
|
9
9
|
- if defined? User
|
10
10
|
= asset.try(:user)
|
11
11
|
= f.input :title, :hint => "Give this asset a title"
|
12
|
-
= f.input :description, :as => :string, :hint => "Give this asset a description"
|
13
|
-
= f.input :tags, :hint => "Used for searching and filtering. Separate multiple tags with a comma (i.e. blue,car,ford)"
|
14
12
|
= f.input :content_type, :hint => "The computer detected type of file. Be careful when changing this value as you may break things."
|
15
13
|
%li
|
16
14
|
%label.label Files
|
data/spec/internal/db/schema.rb
CHANGED
data/spec/models/asset_spec.rb
CHANGED
@@ -24,7 +24,7 @@ describe Effective::Asset do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'should be creatable from URL' do
|
27
|
-
asset = Effective::Asset.create_from_url(image_url, {:title => 'a title', :
|
27
|
+
asset = Effective::Asset.create_from_url(image_url, {:title => 'a title', :user_id => 1})
|
28
28
|
|
29
29
|
# A new asset should exist, and it should be unprocessed
|
30
30
|
asset.should_not eq false
|
@@ -48,8 +48,6 @@ describe Effective::Asset do
|
|
48
48
|
asset.processed.should eq true
|
49
49
|
asset.data.kind_of?(TestAssetUploader).should eq true
|
50
50
|
asset.title.should eq 'a title'
|
51
|
-
asset.description.should eq 'a description'
|
52
|
-
asset.tags.should eq 'a tags'
|
53
51
|
asset.user_id.should eq 1
|
54
52
|
asset.versions_info.present?.should eq true
|
55
53
|
asset.content_type.should eq 'image/png'
|
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.
|
4
|
+
version: 1.4.0
|
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-
|
11
|
+
date: 2015-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|