cortex-plugins-core 0.4.1 → 0.4.2
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 +4 -4
- data/app/models/asset_field_type.rb +6 -1
- data/lib/cortex/plugins/core/version.rb +1 -1
- data/lib/tasks/cortex/core/media.rake +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: d11714ff9c79eac6efd7126c5154e3bc16e28ff3
|
|
4
|
+
data.tar.gz: e8760f828e72d14cd529856e951be79ef4d7771e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7e756903799ddffd5b01b42baae0f07c15969cfc113211c8d13accdcc4780ad5f1f1c03ed29bdc4517aa763124edceb697229c0e5d109e5cc513acbb9803670
|
|
7
|
+
data.tar.gz: ee22c36e3ab4ebe3ab5c403cedb81cd04e4f753d7c7ea09880de6238f51123f3862c74bc16227e43a9255fbd0c9d73d593cb24b552501e0ea060e0898ec728e8
|
|
@@ -20,6 +20,7 @@ class AssetFieldType < FieldType
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def data=(data_hash)
|
|
23
|
+
@existing_data = data_hash.deep_symbolize_keys[:existing_data]
|
|
23
24
|
self.asset = data_hash.deep_symbolize_keys[:asset]
|
|
24
25
|
end
|
|
25
26
|
|
|
@@ -27,7 +28,7 @@ class AssetFieldType < FieldType
|
|
|
27
28
|
{
|
|
28
29
|
'asset': {
|
|
29
30
|
'file_name': asset_file_name,
|
|
30
|
-
'url':
|
|
31
|
+
'url': url,
|
|
31
32
|
'dimensions': dimensions,
|
|
32
33
|
'content_type': asset_content_type,
|
|
33
34
|
'file_size': asset_file_size,
|
|
@@ -113,4 +114,8 @@ class AssetFieldType < FieldType
|
|
|
113
114
|
def validate_asset_content_type
|
|
114
115
|
attachment_content_type_validator.validate_each(self, :asset, asset)
|
|
115
116
|
end
|
|
117
|
+
|
|
118
|
+
def url
|
|
119
|
+
@existing_data.empty? ? asset.url : @existing_data[:asset][:url]
|
|
120
|
+
end
|
|
116
121
|
end
|
|
@@ -17,7 +17,7 @@ namespace :cortex do
|
|
|
17
17
|
|
|
18
18
|
puts "Creating Fields..."
|
|
19
19
|
|
|
20
|
-
allowed_asset_content_types = %w(txt pdf doc docx xls xlsx png jpg gif bmp)
|
|
20
|
+
allowed_asset_content_types = %w(txt css js pdf doc docx ppt pptx csv xls xlsx svg ico png jpg gif bmp)
|
|
21
21
|
media.fields.new(name: 'Asset', field_type: 'asset_field_type',
|
|
22
22
|
validations:
|
|
23
23
|
{
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cortex-plugins-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- CareerBuilder Employer Site & Content Products
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-10-
|
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|