fix deleting columns

pull/35/head
Ondřej Hruška 6 years ago
parent c0bc64a2e7
commit f6109b5d4a
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 5
      app/Models/Proposal.php

@ -137,9 +137,10 @@ class Proposal extends BaseModel
'proposal_id' => $this->getKey(), 'proposal_id' => $this->getKey(),
'note' => $changeset->note, 'note' => $changeset->note,
'row_count' => 0, // Will be set later when we are sure about the row count 'row_count' => 0, // Will be set later when we are sure about the row count
'columns' => array_map(function(Column $c) { 'columns' => array_filter(array_map(function(Column $c) {
if ($c->toRemove) return null;
return $c->toArray(false); return $c->toArray(false);
}, $columns), }, $columns)),
]); ]);
$newRevision->save(); // this gives it an ID, needed to associate rows $newRevision->save(); // this gives it an ID, needed to associate rows

Loading…
Cancel
Save