-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4818d77
commit b7d0769
Showing
6 changed files
with
54 additions
and
36 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
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
10 changes: 5 additions & 5 deletions
10
source/examples/generated/kotlin/CreateTest.snippet.create-new-realm-object.kt
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,16 +1,16 @@ | ||
// Open a write transaction | ||
realm.write { | ||
// Instantiate a new unmanaged Frog object | ||
val frog = Frog().apply { | ||
val unmanagedFrog = Frog().apply { | ||
name = "Kermit" | ||
age = 42 | ||
owner = "Jim Henson" | ||
} | ||
assertFalse(frog.isManaged()) | ||
assertFalse(unmanagedFrog.isManaged()) | ||
|
||
// Copy the object to the realm to return a managed instance | ||
copyToRealm(frog) | ||
assertTrue(frog.isManaged()) | ||
// Copy the object to realm to return a managed instance | ||
val managedFrog = copyToRealm(unmanagedFrog) | ||
assertTrue(managedFrog.isManaged()) | ||
|
||
// Work with the managed object ... | ||
} |
2 changes: 1 addition & 1 deletion
2
source/examples/generated/kotlin/CreateTest.snippet.create-unmanaged-copy.kt
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