Skip to content

Commit

Permalink
Revert to historical behavior to let TMVCActiveRecord.Create use Lazy…
Browse files Browse the repository at this point in the history
…Connection by default
  • Loading branch information
danieleteti committed Jan 22, 2025
1 parent b98f556 commit 9893408
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions sources/MVCFramework.ActiveRecord.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1612,13 +1612,6 @@ procedure TMVCActiveRecord.InitTableInfo(const aTableName: String);
begin
lTableMap.fPrimaryKeyInInsert :=
[foAutoGenerated,foReadOnly,foDoNotInsert] * MVCTableFieldAttribute(lAttribute).FieldOptions = [];

// (not (foAutoGenerated in MVCTableFieldAttribute(lAttribute).FieldOptions))
// and
// (not (foReadOnly in MVCTableFieldAttribute(lAttribute).FieldOptions))
// and
// (not (foDoNotInsert in MVCTableFieldAttribute(lAttribute).FieldOptions))
// ;
lTableMap.fPrimaryKey := lRTTIField;
lPrimaryFieldTypeAsStr := lTableMap.fPrimaryKey.FieldType.ToString.ToLowerInvariant;
if lPrimaryFieldTypeAsStr.EndsWith('int64') then
Expand Down Expand Up @@ -4859,7 +4852,7 @@ constructor MVCNamedRQLQueryAttribute.Create(aName, aRQL: String);

constructor TMVCActiveRecord.Create;
begin
Create(False); //was "true" until 2025-01-22
Create(True);
end;

class function TMVCActiveRecord.CreateQuery(const Unidirectional, DirectExecute: Boolean): TFDQuery;
Expand Down

0 comments on commit 9893408

Please sign in to comment.