]> BookStack Code Mirror - bookstack/blobdiff - app/Page.php
Changes as per code review, and fixes failing test cases.
[bookstack] / app / Page.php
index db6996c23494da1f9f5fdc717ddc2fbe43127ff4..5c03e7d66f610d21b8499370307314b924bcca3d 100644 (file)
@@ -119,9 +119,6 @@ class Page extends Entity
      */
     public function getCurrentRevision()
     {
-        if ($id = PageRevision::where('page_id', '=', $this->id)->max('id')) {
-            return PageRevision::find($id);
-        }
-        return null;
+        return $this->revisions()->first();
     }
 }