Browse Source
Merge pull request #143 from mprasil/update_revision_fix
Actually update the revision date for user struct, not just in DB
pull/145/head
Daniel García
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
1 deletions
-
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(())) |
|
|
|
} |
|
|
|
|
|
|
|