Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-mongodb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
laravel-mongodb
Commits
b95dbb15
Commit
b95dbb15
authored
Feb 26, 2014
by
Jens Segers
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #136 from neoxia/master-fix-breaking-tests
Fix broken tests and a bug about relations
parents
5d3343b3
10c6a9cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
Model.php
src/Jenssegers/Eloquent/Model.php
+1
-3
RelationsTest.php
tests/RelationsTest.php
+1
-1
No files found.
src/Jenssegers/Eloquent/Model.php
View file @
b95dbb15
...
...
@@ -191,9 +191,7 @@ abstract class Model extends \Illuminate\Database\Eloquent\Model {
// title of this relation since that is a great convention to apply.
if
(
is_null
(
$relation
))
{
$caller
=
$this
->
getBelongsToManyCaller
();
$name
=
$caller
[
'function'
];
$relation
=
$this
->
getBelongsToManyCaller
();
}
// First, we'll need to determine the foreign key and "other key" for the
...
...
tests/RelationsTest.php
View file @
b95dbb15
...
...
@@ -68,7 +68,7 @@ class RelationsTest extends PHPUnit_Framework_TestCase {
Item
::
create
(
array
(
'type'
=>
'sword'
,
'user_id'
=>
$user
->
_id
));
Item
::
create
(
array
(
'type'
=>
'bag'
,
'user_id'
=>
null
));
$items
=
Item
::
with
(
'user'
)
->
get
();
$items
=
Item
::
with
(
'user'
)
->
orderBy
(
'user_id'
,
'desc'
)
->
get
();
$user
=
$items
[
0
]
->
getRelation
(
'user'
);
$this
->
assertInstanceOf
(
'User'
,
$user
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment