File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
lib/matestack/ui/vue_js/components/form Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,13 @@ const componentDef = {
99
99
removeItem : function ( ) {
100
100
Vue . set ( this . data , "_destroy" , true )
101
101
this . hideNestedForm = true ;
102
- if ( this . data [ "id" ] == null ) {
102
+ var primaryKey ;
103
+ if ( this . props [ "primary_key" ] != undefined ) {
104
+ primaryKey = this . props [ "primary_key" ] ;
105
+ } else {
106
+ primaryKey = id ;
107
+ }
108
+ if ( this . data [ primaryKey ] == null ) {
103
109
this . $parent . deletedNestedNewInstanceFormsCount [ this . props [ "fields_for" ] ] ++ ;
104
110
}
105
111
} ,
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def vue_props
56
56
emit : ctx . emit ,
57
57
delay : ctx . delay ,
58
58
fields_for : ctx . fields_for ,
59
- new_instance_on_demand : ctx . new_instance_on_demand
59
+ primary_key : context . for &. class &. primary_key
60
60
}
61
61
end
62
62
You can’t perform that action at this time.
0 commit comments