Skip to content

Commit e8e6a8a

Browse files
committed
chore(Media ContentType): add name_id field to all Fields
1 parent 3e732e0 commit e8e6a8a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/cortex/plugins/core/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Cortex
22
module Plugins
33
module Core
4-
VERSION = '2.1.0'
4+
VERSION = '2.1.1'
55
end
66
end
77
end

lib/tasks/cortex/core/media.rake

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace :cortex do
1010
puts "Creating Media ContentType..."
1111
media = ContentType.new({
1212
name: "Media",
13+
name_id: "media",
1314
description: "Media for Cortex",
1415
icon: "collections",
1516
tenant: example_tenant,
@@ -21,9 +22,9 @@ namespace :cortex do
2122
puts "Creating Fields..."
2223

2324
allowed_asset_content_types = %w(txt css js pdf doc docx ppt pptx csv xls xlsx svg ico png jpg gif bmp)
24-
fieldTitle = media.fields.new(name: 'Title', field_type: 'text_field_type', validations: { presence: true, uniqueness: true })
25+
fieldTitle = media.fields.new(name: 'Title', name_id: 'title', field_type: 'text_field_type', validations: { presence: true, uniqueness: true })
2526
fieldTitle.save
26-
media.fields.new(name: 'Asset', field_type: 'asset_field_type',
27+
media.fields.new(name: 'Asset', name_id: 'asset', field_type: 'asset_field_type',
2728
validations:
2829
{
2930
presence: true,
@@ -87,10 +88,10 @@ namespace :cortex do
8788
svgo: false
8889
}
8990
})
90-
media.fields.new(name: 'Description', field_type: 'text_field_type', validations: {presence: true})
91-
media.fields.new(name: 'Tags', field_type: 'tag_field_type')
92-
media.fields.new(name: 'Expiration Date', field_type: 'date_time_field_type')
93-
media.fields.new(name: 'Alt Tag', field_type: 'text_field_type')
91+
media.fields.new(name: 'Description', name_id: 'description', field_type: 'text_field_type', validations: {presence: true})
92+
media.fields.new(name: 'Tags', name_id: 'tags', field_type: 'tag_field_type')
93+
media.fields.new(name: 'Expiration Date', name_id: 'expiration_date', field_type: 'date_time_field_type')
94+
media.fields.new(name: 'Alt Tag', name_id: 'alt_tag', field_type: 'text_field_type')
9495

9596
media.save!
9697

0 commit comments

Comments
 (0)