From 4fb09c5b4d2ca1e6e2f263df3b27eacedf86422a Mon Sep 17 00:00:00 2001 From: Miroslav Prasil Date: Tue, 21 Aug 2018 10:36:04 +0100 Subject: [PATCH] Actually update the revision date for user struct, not just in DB --- src/db/models/user.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db/models/user.rs b/src/db/models/user.rs index 9378824..94becf7 100644 --- a/src/db/models/user.rs +++ b/src/db/models/user.rs @@ -155,12 +155,13 @@ impl User { } pub fn update_revision(&mut self, conn: &DbConn) -> QueryResult<()> { + self.updated_at = Utc::now().naive_utc(); diesel::update( users::table.filter( users::uuid.eq(&self.uuid) ) ) - .set(users::updated_at.eq(Utc::now().naive_utc())) + .set(users::updated_at.eq(&self.updated_at)) .execute(&**conn).and(Ok(())) }