@@ -769,15 +769,15 @@ function addProperties(model, Class, classId) {
769
769
return runtimeArr ;
770
770
} else {
771
771
if ( Array . isArray ( position ) ) { // we replace the collection
772
- if ( _isValidCollection ( position , propertyType [ 0 ] ) ) {
772
+ if ( _isValidCollection ( position , propertyType === 'array' ? 'any' : propertyType [ 0 ] ) ) {
773
773
search = $db [ classId ] . find ( {
774
774
'_id' : this . id ( )
775
775
} ) ;
776
776
if ( search . length ) {
777
777
778
778
component = search [ 0 ] ;
779
- realVal = _getRealCollection ( position , propertyType [ 0 ] ) ;
780
-
779
+ realVal = _getRealCollection ( position , propertyType === 'array' ? 'any' : propertyType [ 0 ] ) ;
780
+
781
781
$workflow . state ( {
782
782
'component' : this . id ( ) ,
783
783
'state' : propertyName ,
@@ -802,7 +802,7 @@ function addProperties(model, Class, classId) {
802
802
if ( typeof position === 'number' ) {
803
803
val = $db . store [ classId ] [ this . id ( ) ] [ propertyName ] [ position ] ;
804
804
if ( val ) {
805
- if ( $metamodel . isClassName ( propertyType [ 0 ] ) ) {
805
+ if ( $metamodel . isClassName ( propertyType === 'array' ? 'array' : propertyType [ 0 ] ) ) {
806
806
realVal = $helper . getRuntime ( ) . require ( val ) ;
807
807
} else {
808
808
realVal = val ;
@@ -819,15 +819,15 @@ function addProperties(model, Class, classId) {
819
819
$log . readOnlyProperty ( this . id ( ) , this . constructor . name , propertyName ) ;
820
820
} else {
821
821
if (
822
- $metamodel . isValidType ( value , propertyType [ 0 ] ) ||
823
- ( $metamodel . inheritFrom ( value . constructor . name , propertyType [ 0 ] . replace ( '@' , '' ) ) && $metamodel . isClassName ( propertyType [ 0 ] ) )
822
+ $metamodel . isValidType ( value , propertyType === 'array' ? 'any' : propertyType [ 0 ] ) ||
823
+ ( $metamodel . inheritFrom ( value . constructor . name , propertyType === 'array' ? 'array' : propertyType [ 0 ] . replace ( '@' , '' ) ) && $metamodel . isClassName ( propertyType === 'array' ? 'array' : propertyType [ 0 ] ) )
824
824
) {
825
825
search = $db [ classId ] . find ( {
826
826
'_id' : this . id ( )
827
827
} ) ;
828
828
if ( search . length ) {
829
829
830
- if ( $metamodel . isClassName ( propertyType [ 0 ] ) ) {
830
+ if ( $metamodel . isClassName ( propertyType === 'array' ? 'array' : propertyType [ 0 ] ) ) {
831
831
switch ( true ) {
832
832
case typeof value === 'string' :
833
833
realVal = value ;
0 commit comments