Skip to content

Commit

Permalink
https://github.com/danieleteti/delphimvcframework/issues/349
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Mar 30, 2020
1 parent 1fd7740 commit 841edeb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -195,6 +195,8 @@ end;

- New! Added `TMVCActiveRecord.Count<T>(RQL)` to count record based on RQL criteria

- New! `TMVCActiveRecord` can handle non autogenerated primary key.

- New! Calling `<jsonrpcendpoint>/describe` returns the methods list available for that endpoint.

- New! Experimental (alpha stage) support for Android servers!
Expand Down Expand Up @@ -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)).

Expand All @@ -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)
Expand Down Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion sources/MVCFramework.Serializer.Commons.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion unittests/general/Several/ActiveRecordTestsU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions unittests/general/Several/BOs.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down
Binary file removed unittests/general/Several/Win32/GUI/sqlitetest.db
Binary file not shown.
6 changes: 3 additions & 3 deletions unittests/general/TestServer/TestServerControllerU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 841edeb

Please sign in to comment.