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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eef4e993c8285a964b573870355b3ea0a9f3b8ee
4
- data.tar.gz: a07339bbaeaf7566a3c9232fd0725707ae129168
3
+ metadata.gz: d11714ff9c79eac6efd7126c5154e3bc16e28ff3
4
+ data.tar.gz: e8760f828e72d14cd529856e951be79ef4d7771e
5
5
  SHA512:
6
- metadata.gz: 6f6acb7632a9870260235fc79fbb7a9448179096ded810c295f23bb1befe5d58dbae148e3037479256768982354bbb96a96b81f25a4a9b6809574082bdc38514
7
- data.tar.gz: d076b9d5dd73d6f461f256d28a993d1056f2929dd76e76fbcdbb3ad2774f76b52be1303ea483679c049ef3bf1d3d7b3a57f33025d4bf7e44673f265b4063103b
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': asset.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
@@ -1,7 +1,7 @@
1
1
  module Cortex
2
2
  module Plugins
3
3
  module Core
4
- VERSION = '0.4.1'
4
+ VERSION = '0.4.2'
5
5
  end
6
6
  end
7
7
  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.1
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-20 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails