use prepare_table() only with a database and not for flat strings
Model::prepare_table() will create a log: "you should provide the table name...." and it is not needed if a Model object is used only for flat strings
This commit is contained in:
@@ -969,10 +969,11 @@ protected:
|
||||
field_model.model_env = &model_env_local;
|
||||
field_model.model_env->has_primary_key_set = field_model.has_primary_key_set;
|
||||
field_model.set_connector(model_connector);
|
||||
field_model.prepare_table();
|
||||
|
||||
if( !is_empty_field(db_field_name) )
|
||||
{
|
||||
field_model.prepare_table();
|
||||
|
||||
if( field_type.is_foreign_key() || field_type.is_foreign_key_in_child() )
|
||||
{
|
||||
field_model_for_db(db_field_name, field_model, field_type);
|
||||
@@ -993,6 +994,7 @@ protected:
|
||||
{
|
||||
if( model_env->model_work_mode == MORM_MODEL_WORK_MODE_GENERATING_FLAT_STRING )
|
||||
{
|
||||
// calling field_model.prepare_table(); is not needed in generating strings (at least for json/space formats)
|
||||
field_model_generate_flat_string(flat_field_name, field_model, field_type);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user