diff --git a/app/decorators/alchemy/element_editor.rb b/app/decorators/alchemy/element_editor.rb index 8e591bac54..a0affbf90b 100644 --- a/app/decorators/alchemy/element_editor.rb +++ b/app/decorators/alchemy/element_editor.rb @@ -55,7 +55,7 @@ def css_classes def editable? return false if folded? - content_definitions.present? || taggable? + content_definitions.present? || ingredient_definitions.any? || taggable? end # Fixes Rails partial renderer calling to_model on the object diff --git a/spec/decorators/alchemy/element_editor_spec.rb b/spec/decorators/alchemy/element_editor_spec.rb index bca04dc838..a23cd85143 100644 --- a/spec/decorators/alchemy/element_editor_spec.rb +++ b/spec/decorators/alchemy/element_editor_spec.rb @@ -178,6 +178,18 @@ it { is_expected.to eq(false) } end + + context "but element has ingredients defined" do + before { + expect(element).to receive(:ingredient_definitions) { + [{ + role: "headline", type: "Headline", + }] + } + } + + it { is_expected.to eq(true) } + end end end end