Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Conversation

@omnuvito
Copy link

Fixing SoftDeleteBehavior belongsTo when import users on fixture

CakeDC pushed a commit that referenced this pull request Jun 22, 2015
Issue #138 Fixing SoftDeleteBehavior belongsTo when import users on fixture
@CakeDC CakeDC merged commit fd69d2b into CakeDC:develop Jun 22, 2015
@ravage84
Copy link

Unfortunately this only covers 50 % of the cases, cause it does not attribute to belongsTo associations with aliases named differenlty than the model class.

I updated my repo to showcase the problem.

The repo with your fix, which solves the problem in the repo:
https://github.com/ravage84/softdeletebbehavior-prob/tree/22d378844492922794a719bb34a062003bb7e473

But it didn't work for me in my actual code, cause it uses differently named aliases, like so:
ravage84/softdeletebbehavior-prob@e5c3489?diff=unified

With this, the model can't be found cause it searches a model named like the alias.

I fixed it with this:
ravage84/softdeletebbehavior-prob@4cf935c

I wonder, though, if CakePHP provides a function to load such an association, so the fix doesn't need to do that "by hand".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants