Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5' into 6
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Extension/FluentExtension.php
  • Loading branch information
tractorcow committed Mar 24, 2024
2 parents 42ecdc3 + 182e829 commit 4c1f1e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Model/CachableModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace TractorCow\Fluent\Model;

use SilverStripe\Control\HTTPRequest;
use SilverStripe\Core\ClassInfo;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Injector\Injector;
Expand Down Expand Up @@ -69,6 +70,13 @@ public static function clearCached()
*/
protected static function databaseIsReady()
{
// Outside of dev/ don't actually do any checks, assume ready
/** @var HTTPRequest $request */
$request = Injector::inst()->get(HTTPRequest::class);
if (stripos($request->getURL(false), 'dev/') !== 0) {
return true;
}

$object = DataObject::singleton(static::class);

// if any of the tables aren't created in the database
Expand Down

0 comments on commit 4c1f1e8

Please sign in to comment.