Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Fix soft deleted doesn't work when upgraded Laravel 4.2 #222

Closed
wants to merge 1 commit into from
Closed

Fix soft deleted doesn't work when upgraded Laravel 4.2 #222

wants to merge 1 commit into from

Conversation

CasperLaiTW
Copy link

Fix #211

rebase commits from #212

Jaspaul added a commit to Soapbox/ardent that referenced this pull request Jul 9, 2014
Imported fix from laravel-ardent#222 since
it has not yet been merged into the main repository.
Jaspaul added a commit to Soapbox/ardent that referenced this pull request Jul 9, 2014
Imported fix from laravel-ardent#222 since
it has not yet been merged into the main repository.
Jaspaul referenced this pull request in Soapbox/ardent Jul 9, 2014
Imported fix from laravelbook#222 since it has not yet been
merged into the main repository. Recommitting to fix formatting.
@foozee
Copy link

foozee commented Jul 16, 2014

@igorsantos07 please merge this, it's really needed for any software-as-a-service implementation using ardent + l 4.2, because of the global scopes that doesn't get set on boot #220 .... is there any foreseen regressions caused by this? can I help fix/test any?

@marcioAlmada
Copy link

Yes, we really need this fixed. Global scopes are very important for multi-tenancy.

@marcioAlmada
Copy link

ping... @laravelbook is this project still being maintained?

@CasperLaiTW
Copy link
Author

My workaround for model extends the BaseModel and override the newQuery method.

class BaseModel extends \LaravelBook\Ardent\Ardent {
    public function newQuery($excludeDeleted = true)
    {
        $builder = new Builder($this->newBaseQueryBuilder());
        $builder->throwOnFind = static::$throwOnFind;

        // Once we have the query builders, we will set the model instances so the
        // builder can easily access any information it may need from the model
        // while it is constructing and executing various queries against it.
        $builder->setModel($this)->with($this->with);

        return $this->applyGlobalScopes($builder);
    }
}
class Post extends BaseModel {
   // do you want.
}

Maybe you can try this way.

@marcioAlmada
Copy link

@CasperLaiTW Thanks. I'm currently using a fork with the fix applied. Only asked because the project really seems abandoned.

@markalanevans
Copy link

+1

@RodrigoBalest
Copy link

+1
Is the project still mantained? Right now, the last commit is dated to 10 jul 2014 on the master branch.

@igorsantos07
Copy link
Member

Hey guys, I'm trying to catch up on the project. I'm really sorry for being gone, had academic + health issues.
If possible, please lend me a hand at #227, as this issue seems complicated and there are different fixes.
I'm closing this now as it seems that's the one that worked. I'm unsure, though (that's why I'm asking for help! haha)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Laravel 4.2 soft delete doesn't work with Ardent
6 participants