From 5a11fd349f046e95cd38fdeb573e5addd8f10924 Mon Sep 17 00:00:00 2001 From: Amitai Burstein Date: Mon, 26 Aug 2024 14:48:43 +0300 Subject: [PATCH] Allow set parent fields --- ihp-ide/IHP/SchemaCompiler.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ihp-ide/IHP/SchemaCompiler.hs b/ihp-ide/IHP/SchemaCompiler.hs index 60cbb95c8..49ea02bc6 100644 --- a/ihp-ide/IHP/SchemaCompiler.hs +++ b/ihp-ide/IHP/SchemaCompiler.hs @@ -1107,7 +1107,7 @@ compileInclude table@(CreateTable { name, columns, inherits }) = (belongsToInclu compileSetFieldInstances :: (?schema :: Schema) => CreateTable -> Text -compileSetFieldInstances table@(CreateTable { name, columns, inherits }) = unlines (map compileSetField (dataFields table)) +compileSetFieldInstances table@(CreateTable { name, columns, inherits }) = unlines (map compileSetField allDataFields) where setMetaField = "instance SetField \"meta\" (" <> compileTypePattern table <> ") MetaBag where\n {-# INLINE setField #-}\n setField newValue (" <> compileDataTypePattern table <> ") = " <> tableNameToModelName name <> " " <> (unwords (map (.name) columns)) <> " newValue" modelName = tableNameToModelName name