Add dfc_name field on Spree::Taxons

This will let us map OFN product taxons to DFC product types
This commit is contained in:
Gaetan Craig-Riou
2023-10-27 15:48:47 +11:00
parent 83beafc564
commit 652c7a563c
5 changed files with 13 additions and 2 deletions

View File

@@ -117,8 +117,8 @@ module Spree
def taxon_params
params.require(:taxon).permit(
:name, :parent_id, :position, :icon, :description, :permalink,
:taxonomy_id, :meta_description, :meta_keywords, :meta_title
:name, :parent_id, :position, :icon, :description, :permalink, :taxonomy_id,
:meta_description, :meta_keywords, :meta_title, :dfc_name
)
end
end

View File

@@ -24,6 +24,10 @@
= f.label :meta_keywords, t(".meta_keywords")
%br/
= f.text_field :meta_keywords, class: 'fullwidth', rows: 6
= f.field_container :dfc_name do
= f.label :dfc_name, t(".dfc_name")
%br/
= f.text_field :dfc_name, class: 'fullwidth', rows: 6
.omega.seven.columns
= f.field_container :description do
= f.label :description, t(".description")

View File

@@ -4487,6 +4487,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
meta_description: Meta Description
meta_keywords: Meta Keywords
description: Description
dfc_name: DFC name
general_settings:
edit:
legal_settings: "Legal Settings"

View File

@@ -0,0 +1,5 @@
class AddDfcNameToSpreeTaxons < ActiveRecord::Migration[7.0]
def change
add_column :spree_taxons, :dfc_name, :string
end
end

View File

@@ -881,6 +881,7 @@ ActiveRecord::Schema[7.0].define(version: 20231003000823494) do
t.string "meta_title", limit: 255
t.string "meta_description", limit: 255
t.string "meta_keywords", limit: 255
t.string "dfc_name"
t.index ["parent_id"], name: "index_taxons_on_parent_id"
t.index ["permalink"], name: "index_taxons_on_permalink"
t.index ["taxonomy_id"], name: "index_taxons_on_taxonomy_id"