mergeAndValidate method

Future mergeAndValidate()

Implementation

Future<dynamic> mergeAndValidate() async {
  dynamic oldModel = await Collection.get(id: getCollection())
      .getModelWithoutFallback(getId());

  if (oldModel != null) {
    _data = await oldModel.merge(_data);
  }

  if (!await validate()) {
    return null;
  }

  return this;
}