Skip to content

Commit

Permalink
TableName is no more serialized in ActiveRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Jul 18, 2020
1 parent ba9e744 commit 0d7fa46
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,4 @@ unittests/general/Several/Win32/GUI/sqlitetest.db
*.db-journal
*.txaPackage
unittests/general/Several/bin/sqlitetest.db
unittests/general/Several/bin/firebirdtest.fdb
1 change: 1 addition & 0 deletions sources/MVCFramework.ActiveRecord.pas
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ TMVCActiveRecord = class
function TryGetPKValue(var Value: TValue; out IsNullableType: Boolean): Boolean;
procedure AddChildren(const ChildObject: TObject);
procedure RemoveChildren(const ChildObject: TObject);
[MVCDoNotSerialize]
property TableName: String read fTableName write SetTableName;
[MVCDoNotSerialize]
property PrimaryKeyIsAutogenerated: Boolean read GetPrimaryKeyIsAutogenerated write SetPrimaryKeyIsAutogenerated;
Expand Down
1 change: 1 addition & 0 deletions sources/MVCFramework.Commons.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@ function CamelCase(const Value: string; const MakeFirstUpperToo: Boolean): strin
lIsUpperCase, lPreviousWasUpperCase: Boolean;
lIsAlpha: Boolean;
begin
{TODO -oDanieleT -cGeneral : Make this function faster!}
lNextUpCase := MakeFirstUpperToo;
lPreviousWasUpperCase := True;
lSB := TStringBuilder.Create;
Expand Down
3 changes: 2 additions & 1 deletion sources/MVCFramework.Serializer.Commons.pas
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,8 @@ class function TMVCSerializerHelper.GetKeyName(const AProperty: TRttiProperty; c
Attrs: TArray<TCustomAttribute>;
Attr: TCustomAttribute;
begin
{ in un rendering di una lista, quante volte viene chiamata questa funzione? }
{ TODO -oDanieleT -cGeneral : in un rendering di una lista, quante volte viene chiamata questa funzione?}
{ Tante volte, ma eliminando tutta la logica si guadagnerebbe al massiom il 6% nel caso tipico, forse non vale la pena di aggiungere una cache apposita }
Result := AProperty.Name;

Attrs := AProperty.GetAttributes;
Expand Down
4 changes: 2 additions & 2 deletions sources/MVCFramework.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2968,8 +2968,8 @@ function TMVCController.GetClientId: string;

function TMVCRenderer.GetContentType: string;
begin
Result := GetContext.Response.ContentType;
if Result.Trim.IsEmpty then
Result := GetContext.Response.ContentType.Trim;
if Result.IsEmpty then
begin
GetContext.Response.ContentType := FContext.FConfig[MVCFramework.Commons.TMVCConfigKey.DefaultContentType];
Result := GetContentType;
Expand Down

0 comments on commit 0d7fa46

Please sign in to comment.