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

In Ardent\belongsTo function $relation was being over-written with the calling function name. #258

Merged
merged 2 commits into from
May 10, 2015

Conversation

samuel-cloete
Copy link
Contributor

First time open-source contributor here.. Have been using Ardent for a while, and it's really great! Thank you!

In Ardent\belongsTo function $relation was being over-written with the calling function name. I picked this up when trying to associate a model relationship dynamically via $model->belongsTo($related, $foreignKey, $otherKey, $relation)->associate($relationModel);

…cked this up when trying to associate a model relationship dynamically via $model->belongsTo($related, $foreignKey, $otherKey, $relation)->associate($relationModel);
@igorsantos07
Copy link
Member

This is legit! However, please wrap all the backtrace call in your if, since it's not needed if the relation name is provided.
Also, avoid one-line structures, as per PSR-2

@samuel-cloete
Copy link
Contributor Author

Ah ok, makes sense... have done so..

@igorsantos07
Copy link
Member

thank you! congrats on your first PR man :) haha

igorsantos07 added a commit that referenced this pull request May 10, 2015
In `Ardent\belongsTo` $relation was being over-written with the calling function name
@igorsantos07 igorsantos07 merged commit b2298eb into laravel-ardent:master May 10, 2015
@samuel-cloete
Copy link
Contributor Author

woohoo! haha! thanks. Was about time.. have been using different open source libraries but haven't had the privilege of contributing yet.. to many more :)

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.

2 participants