diff --git a/README.md b/README.md index 0f11f8f27..8eaa58343 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,9 @@ Congratulations to Daniele Teti and all the staff for the excellent work!" -- Ma * Works on Linux (Delphi 10.2 Tokyo or better) * Completely unit tested (more than 130 unit tests) * There is a sample for each functionality (check the [dmvcframework_(yourversion)_samples.zip](https://github.com/danieleteti/delphimvcframework/releases)) - * Server side generated pages using [Mustache for Delphi](https://github.com/synopse/dmustache) + * Server side generated pages using [Mustache for Delphi](https://github.com/synopse/dmustache) or [TemplatePro](https://github.com/danieleteti/templatepro) * Specific trainings are available (email to `professionals@bittime.it` for a date and a place) - * Messaging extension using [ServerSentEvents](https://github.com/danieleteti/delphimvcframework/tree/master/samples/serversentevents) + * Push notifications support using [ServerSentEvents](https://github.com/danieleteti/delphimvcframework/tree/master/samples/serversentevents) * Automatic documentation through `/system/describeserver.info` * Driven by its huge community (Facebook group https://www.facebook.com/groups/delphimvcframework) * Semantic Versioning @@ -195,6 +195,8 @@ end; - New! Added `TMVCActiveRecord.Count(RQL)` to count record based on RQL criteria +- New! `TMVCActiveRecord` can handle non autogenerated primary key. + - New! Calling `/describe` returns the methods list available for that endpoint. - New! Experimental (alpha stage) support for Android servers! @@ -249,9 +251,9 @@ begin end; ``` - New! Shortcut render' methods which simplify RESTful API development - - `procedure ResponseCreated(const Location: String = ''; const Reason: String = 'Created'); virtual;` - - ` procedure ResponseAccepted(const HREF: String; const ID: String; const Reason: String = 'Accepted'); virtual;` - - `procedure ResponseNoContent(const Reason: String = 'No Content'); virtual;` + - `procedure Render201Created(const Location: String = ''; const Reason: String = 'Created'); virtual;` + - ` procedure Render202Accepted(const HREF: String; const ID: String; const Reason: String = 'Accepted'); virtual;` + - `procedure Render204NoContent(const Reason: String = 'No Content'); virtual;` - Added de/serializing iterables (e.g. generic lists) support without `MVCListOf` attribute (Thank you to [João Antônio Duarte](https://github.com/joaoduarte19)). @@ -277,6 +279,8 @@ end; - New! The **MVCAREntitiesGenerator** can optionally register all the generated entities also in the `ActiveRecordMappingRegistry` (Thanks to [Fabrizio Bitti](https://twitter.com/fabriziobitti) from [bit Time Software](http://www.bittime.it)) +- Fixed! [issue38](https://github.com/danieleteti/delphimvcframework/issues/38) + - Fixed! [issue184](https://github.com/danieleteti/delphimvcframework/issues/184) - Fixed! [issue278](https://github.com/danieleteti/delphimvcframework/issues/278) @@ -305,6 +309,8 @@ end; - Fixed! [issue345](https://github.com/danieleteti/delphimvcframework/issues/345) +- Fixed! [issue349](https://github.com/danieleteti/delphimvcframework/issues/349) + - **Breaking Change!** In `MVCActiveRecord` attribute `MVCPrimaryKey` has been removed and merged with `MVCTableField`, so now `TMVCActiveRecordFieldOption` is a set of `foPrimaryKey`, `foAutoGenerated`, `foTransient` (check `activerecord_showcase.dproj` sample). - **Breaking Change!** Middleware `OnAfterControllerAction` are now invoked in the same order of `OnBeforeControllerAction` (previously were invoked in reversed order). diff --git a/sources/MVCFramework.Serializer.Commons.pas b/sources/MVCFramework.Serializer.Commons.pas index 81dd7f1ab..ba565ddd5 100644 --- a/sources/MVCFramework.Serializer.Commons.pas +++ b/sources/MVCFramework.Serializer.Commons.pas @@ -912,7 +912,7 @@ procedure MapDataSetFieldToRTTIField(const AField: TField; const aRTTIField: TRt begin aRTTIField.SetValue(AObject, BCDtoCurrency(AField.AsBCD)); end; - ftFloat: + ftFloat, ftSingle: begin aRTTIField.SetValue(AObject, AField.AsFloat); end; diff --git a/unittests/general/Several/ActiveRecordTestsU.pas b/unittests/general/Several/ActiveRecordTestsU.pas index 56127f7a8..38ff9d218 100644 --- a/unittests/general/Several/ActiveRecordTestsU.pas +++ b/unittests/general/Several/ActiveRecordTestsU.pas @@ -188,7 +188,7 @@ procedure TTestActiveRecord.TestLifeCycle; Assert.AreEqual('OnBeforeLoad|MapDatasetToObject|OnAfterLoad', lCustomer.GetHistory); lCustomer.ClearHistory; lCustomer.Delete; - Assert.AreEqual('OnBeforeDelete|OnBeforeExecuteSQL|MapObjectToParams|OnAfterDelete', lCustomer.GetHistory); + Assert.AreEqual('OnValidation|OnBeforeDelete|OnBeforeExecuteSQL|MapObjectToParams|OnAfterDelete', lCustomer.GetHistory); finally lCustomer.Free; end; diff --git a/unittests/general/Several/BOs.pas b/unittests/general/Several/BOs.pas index 5180fca26..a4440fb8d 100644 --- a/unittests/general/Several/BOs.pas +++ b/unittests/general/Several/BOs.pas @@ -99,7 +99,7 @@ TCustomerWithLF = class(TCustomer) function GetHistory: String; procedure ClearHistory; protected - procedure OnValidation; override; + procedure OnValidation(const Action: TMVCEntityAction); override; procedure OnAfterLoad; override; procedure OnBeforeLoad; override; procedure OnBeforeInsert; override; @@ -1058,7 +1058,7 @@ procedure TCustomerWithLF.OnBeforeUpdate; fHistory.Add('OnBeforeUpdate'); end; -procedure TCustomerWithLF.OnValidation; +procedure TCustomerWithLF.OnValidation(const Action: TMVCEntityAction); begin inherited; fHistory.Add('OnValidation'); diff --git a/unittests/general/Several/Win32/GUI/sqlitetest.db b/unittests/general/Several/Win32/GUI/sqlitetest.db deleted file mode 100644 index b36911a6f..000000000 Binary files a/unittests/general/Several/Win32/GUI/sqlitetest.db and /dev/null differ diff --git a/unittests/general/TestServer/TestServerControllerU.pas b/unittests/general/TestServer/TestServerControllerU.pas index 8c3306dc7..06d9f0ec1 100644 --- a/unittests/general/TestServer/TestServerControllerU.pas +++ b/unittests/general/TestServer/TestServerControllerU.pas @@ -608,17 +608,17 @@ procedure TTestServerController.TestRenderStreamAndFreeWithOwnerTrue; procedure TTestServerController.TestResponseAccepted; begin - ResponseAccepted('http://pippo.it/1234', '1234', 'thisisthereason'); + Render202Accepted('http://pippo.it/1234', '1234', 'thisisthereason'); end; procedure TTestServerController.TestResponseCreated; begin - ResponseCreated('thisisthelocation', 'thisisthereason'); + Render201Created('thisisthelocation', 'thisisthereason'); end; procedure TTestServerController.TestResponseNoContent; begin - ResponseNoContent('thisisthereason'); + Render204NoContent('thisisthereason'); end; procedure TTestServerController.TestSerializeNullables;