diff --git a/app/models/alchemy/element.rb b/app/models/alchemy/element.rb index 1f8c5b9a4e..62153de086 100644 --- a/app/models/alchemy/element.rb +++ b/app/models/alchemy/element.rb @@ -46,6 +46,7 @@ class Element < BaseRecord "compact", "message", "deprecated", + "warning", ].freeze # All Elements that share the same page version and parent element and are fixed or not are considered a list. diff --git a/spec/dummy/config/alchemy/elements.yml b/spec/dummy/config/alchemy/elements.yml index 7477efbcfe..2510ae6c20 100644 --- a/spec/dummy/config/alchemy/elements.yml +++ b/spec/dummy/config/alchemy/elements.yml @@ -299,3 +299,6 @@ - name: key_words type: EssenceText group: details + +- name: element_with_warning + warning: "Do not use this element!" diff --git a/spec/models/alchemy/element_spec.rb b/spec/models/alchemy/element_spec.rb index db4a14ff92..ff8569ce03 100644 --- a/spec/models/alchemy/element_spec.rb +++ b/spec/models/alchemy/element_spec.rb @@ -149,6 +149,16 @@ module Alchemy end end end + + context "with warning in definition" do + let(:element) do + Alchemy::Element.new(name: "element_with_warning") + end + + it "creates element" do + expect { element.save }.to_not raise_error + end + end end describe ".dom_id_class" do