From 7cb33e8615fb059cbd78d2aaec62f228cc598fa3 Mon Sep 17 00:00:00 2001 From: Daniele Teti Date: Fri, 6 Oct 2023 10:42:49 +0200 Subject: [PATCH] Cleanup --- sources/MVCFramework.ActiveRecord.pas | 5 +++++ sources/MVCFramework.View.Renderers.Mustache.pas | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sources/MVCFramework.ActiveRecord.pas b/sources/MVCFramework.ActiveRecord.pas index 83dfbe5e..80702bd4 100644 --- a/sources/MVCFramework.ActiveRecord.pas +++ b/sources/MVCFramework.ActiveRecord.pas @@ -913,6 +913,11 @@ implementation function GetBackEndByConnection(aConnection: TFDConnection): string; begin + if not aConnection.Connected then + begin + aConnection.Connected := True; {required to know the backend} + end; + case Ord(aConnection.RDBMSKind) of 0: Exit(TMVCActiveRecordBackEnd.Unknown); diff --git a/sources/MVCFramework.View.Renderers.Mustache.pas b/sources/MVCFramework.View.Renderers.Mustache.pas index 93b495ba..bcc8279b 100644 --- a/sources/MVCFramework.View.Renderers.Mustache.pas +++ b/sources/MVCFramework.View.Renderers.Mustache.pas @@ -48,8 +48,6 @@ TMVCMustacheViewEngine = class(TMVCBaseViewEngine) function RenderJSON(lViewEngine: TSynMustache; const JSON: RawUTF8; Partials: TSynMustachePartials; Helpers: TSynMustacheHelpers; OnTranslate: TOnStringTranslate; EscapeInvert: boolean): RawUTF8; virtual; public - class constructor Create; - class var CustomHelpers: TSynMustacheHelpers; procedure Execute(const ViewName: string; const OutputStream: TStream); override; constructor Create(const AEngine: TMVCEngine; const AWebContext: TWebContext; const AViewModel: TMVCViewDataObject; @@ -108,11 +106,6 @@ constructor TMVCMustacheViewEngine.Create(const AEngine: TMVCEngine; LoadHelpers; end; -class constructor TMVCMustacheViewEngine.Create; -begin - SetLength(CustomHelpers, 0); -end; - class destructor TMVCMustacheViewEngine.Destroy; begin fPartials.Free;