From ba918b2c3b71126e5c5f8dcff98faf886ff7bf47 Mon Sep 17 00:00:00 2001 From: Basil Suter Date: Tue, 2 May 2017 11:54:36 +0200 Subject: [PATCH] Added type float and double in ngrest data types to use decimal. closes #1215 --- CHANGELOG.md | 1 + core/console/commands/CrudController.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a61b45bb2..9bbc2beea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file. This projec - [#1227](https://github.com/luyadev/luya/issues/1227) Added preloadModels() method for the Menu Query in order to collect all models for the given request. This can strongly reduce the sql count when working with properties or models. - [#1266](https://github.com/luyadev/luya/issues/1266) render() method for the mailer component in order to provide controller template files. - [#1269](https://github.com/luyadev/luya/issues/1269) Add raw option for html block in order to render the html output in admin view. +- [#1215](https://github.com/luyadev/luya/issues/1215) Added type float and double in ngrest data types to use decimal. ### Fixed diff --git a/core/console/commands/CrudController.php b/core/console/commands/CrudController.php index f9f766c96..05e4aef09 100644 --- a/core/console/commands/CrudController.php +++ b/core/console/commands/CrudController.php @@ -301,7 +301,7 @@ public function generateModelContent($fileNamepsace, $className, $apiEndpoint, T if ($v->type == 'integer' || $v->type == 'bigint' || $v->type == 'smallint') { $ngrestFieldConfig[$v->name] = 'number'; } - if ($v->type == 'decimal') { + if ($v->type == 'decimal' || $v->type == 'float' || $v->type == 'double') { $ngrestFieldConfig[$v->name] = 'decimal'; } if ($v->type == 'boolean') {