-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test cases for nested relationships
- Loading branch information
Marcos Javier Alvarez Maestre
committed
Jul 4, 2019
1 parent
f5163ea
commit def32d7
Showing
6 changed files
with
169 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import BaseModel from "../../src/BaseModel"; | ||
import Spec from "./Spec"; | ||
import AreaType from "./AreaType"; | ||
import AreaRoom from "./AreaRoom"; | ||
|
||
export default class Area extends BaseModel { | ||
static get belongsTo() { | ||
return [Spec]; | ||
return [Spec, AreaType]; | ||
} | ||
static get hasMany(){ | ||
return [AreaRoom]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import BaseModel from "../../src/BaseModel"; | ||
import Area from "./Area"; | ||
|
||
export default class AreaRoom extends BaseModel { | ||
static get belongsTo(){ | ||
return [Area] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import BaseModel from "../../src/BaseModel"; | ||
import Spec from "./Spec"; | ||
|
||
export default class AreaType extends BaseModel {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters