1
0
Fork 0
mirror of synced 2024-06-01 10:29:48 +12:00

fix(database): casting of float values

This commit is contained in:
Torsten Dittmann 2022-04-21 15:14:01 +02:00
parent a6c27a3876
commit 25de029992
2 changed files with 6 additions and 1 deletions

View file

@ -181,7 +181,7 @@ if(!empty($user) || !empty($pass)) {
*/
Database::addFilter('casting',
function($value) {
return json_encode(['value' => $value]);
return json_encode(['value' => $value], JSON_PRESERVE_ZERO_FRACTION);
},
function($value) {
if (is_null($value)) {

View file

@ -71,6 +71,11 @@ class DatabaseV1 extends Worker
$dbForConsole = $this->getConsoleDB();
$dbForProject = $this->getProjectDB($projectId);
/**
* Fetch attribute from the database, since with Resque float values are loosing informations.
*/
$attribute = $dbForProject->getDocument('attributes', $attribute->getId());
$event = 'database.attributes.update';
$collectionId = $collection->getId();
$key = $attribute->getAttribute('key', '');