-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from ironirc/alsoFetchNowResolvesCollectionProxy
alsoFetch: (a ToManyRelation) now also resolves the collection proxy
- Loading branch information
Showing
4 changed files
with
88 additions
and
48 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
49 changes: 49 additions & 0 deletions
49
src/Glorp-Integration-Tests/GlorpReadingPersonWithoutEmailAddressesTest.class.st
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,49 @@ | ||
Class { | ||
#name : #GlorpReadingPersonWithoutEmailAddressesTest, | ||
#superclass : #GlorpTestCase, | ||
#instVars : [ | ||
'session', | ||
'personRow' | ||
], | ||
#category : #'Glorp-Integration-Tests-Database' | ||
} | ||
|
||
{ #category : #resources } | ||
GlorpReadingPersonWithoutEmailAddressesTest class >> resources [ | ||
^Array with: GlorpSessionResource. | ||
] | ||
|
||
{ #category : #running } | ||
GlorpReadingPersonWithoutEmailAddressesTest >> setUp [ | ||
|
||
super setUp. | ||
session := GlorpSessionResource current newSession. | ||
session beginTransaction. | ||
personRow := session system examplePersonRow2. | ||
session writeRow: personRow. | ||
|
||
] | ||
|
||
{ #category : #running } | ||
GlorpReadingPersonWithoutEmailAddressesTest >> tearDown [ | ||
|
||
session rollbackTransaction. | ||
session reset. | ||
session := nil. | ||
super tearDown | ||
] | ||
|
||
{ #category : #tests } | ||
GlorpReadingPersonWithoutEmailAddressesTest >> testReadMultipleObjectsOneToMany [ | ||
|
||
| query result person addresses | | ||
|
||
query := Query read: GlorpPerson where: [ :eachPerson | eachPerson id = 4 ]. | ||
query alsoFetch: [ :each | each emailAddresses asOuterJoin ]. | ||
result := query executeIn: session. | ||
self assert: result size equals: 1. | ||
person := result first. | ||
addresses := person emailAddresses. | ||
self deny: addresses isGlorpProxy "testing PR https://github.com/pharo-rdbms/glorp/pull/115". | ||
self assert: addresses size equals: 0 | ||
] |
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