mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-09 23:51:23 +00:00
3.6 - Refactoring and Redundant Test Coverage
This commit is contained in:
@@ -16,7 +16,7 @@ class Order extends Model
|
||||
public function cancel()
|
||||
{
|
||||
foreach ($this->tickets as $ticket) {
|
||||
$ticket->update(['order_id' => null]);
|
||||
$ticket->release();
|
||||
}
|
||||
|
||||
$this->delete();
|
||||
|
||||
@@ -12,4 +12,9 @@ class Ticket extends Model
|
||||
{
|
||||
return $query->whereNull('order_id');
|
||||
}
|
||||
|
||||
public function release()
|
||||
{
|
||||
$this->update(['order_id' => null]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user