Skip to content

Commit

Permalink
Refactor assignable and automation log
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jul 15, 2023
1 parent 453a848 commit 3305f17
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/AutomationRules/Actions/AssignToGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Igniter\Automation\AutomationRules\Actions;

use Igniter\Admin\Traits\Assignable;
use Igniter\Automation\Classes\BaseAction;
use Igniter\Flame\Exception\ApplicationException;
use Igniter\User\Models\Concerns\Assignable;
use Igniter\User\Models\UserGroup;

class AssignToGroup extends BaseAction
Expand Down
12 changes: 12 additions & 0 deletions src/Models/AutomationLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

use Igniter\Flame\Database\Model;
use Igniter\Flame\Database\Traits\Validation;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Prunable;
use Throwable;

class AutomationLog extends Model
{
use Validation;
use Prunable;

/**
* @var string The database table name
Expand Down Expand Up @@ -87,4 +90,13 @@ public function getCreatedSinceAttribute($value)
{
return $this->created_at ? time_elapsed($this->created_at) : null;
}

//
// Concerns
//

public function prunable(): Builder
{
return static::query()->where('created_at', '<=', now()->subDays(setting('activity_log_timeout', 60)));
}
}

0 comments on commit 3305f17

Please sign in to comment.