From 93c5708ba8907248cb8071838e929cdc3af53532 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 16 Aug 2019 11:14:29 +0200 Subject: [PATCH] Fixed issue #1653: Default value not set for attributes of type input, select, tree_select, richtext, textarea, checkbox. --- app/models/object_manager/attribute.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models/object_manager/attribute.rb b/app/models/object_manager/attribute.rb index 2edf9a740..031102816 100644 --- a/app/models/object_manager/attribute.rb +++ b/app/models/object_manager/attribute.rb @@ -683,8 +683,9 @@ to send no browser reload event, pass false model.table_name, attribute.name, data_type, - limit: attribute.data_option[:maxlength], - null: true + limit: attribute.data_option[:maxlength], + default: attribute.data_option[:default], + null: true ) elsif attribute.data_type.match?(/^integer|user_autocompletion|datetime|date$/) ActiveRecord::Migration.change_column( @@ -722,8 +723,9 @@ to send no browser reload event, pass false model.table_name, attribute.name, data_type, - limit: attribute.data_option[:maxlength], - null: true + limit: attribute.data_option[:maxlength], + default: attribute.data_option[:default], + null: true ) elsif attribute.data_type.match?(/^integer|user_autocompletion$/) ActiveRecord::Migration.add_column(