-
Notifications
You must be signed in to change notification settings - Fork 0
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
62324ce
commit 7db5ca2
Showing
3 changed files
with
18 additions
and
13 deletions.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
core/src/main/scala/lightdb/RecordDocumentCollection.scala
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
core/src/main/scala/lightdb/model/RecordDocumentCollection.scala
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,5 @@ | ||
package lightdb.model | ||
|
||
import lightdb.{LightDB, RecordDocument} | ||
|
||
abstract class RecordDocumentCollection[D <: RecordDocument[D]](collectionName: String, db: LightDB) extends Collection[D](collectionName, db) with RecordDocumentModel[D] |
13 changes: 13 additions & 0 deletions
13
core/src/main/scala/lightdb/model/RecordDocumentModel.scala
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,13 @@ | ||
package lightdb.model | ||
|
||
import cats.effect.IO | ||
import fabric.Json | ||
import lightdb.RecordDocument | ||
|
||
trait RecordDocumentModel[D <: RecordDocument[D]] extends DocumentModel[D] { | ||
override def preSetJson(json: Json, collection: AbstractCollection[D]): IO[Json] = IO { | ||
json.modify("modified") { _ => | ||
System.currentTimeMillis() | ||
} | ||
} | ||
} |