fix(database): casting of float values
This commit is contained in:
parent
a6c27a3876
commit
25de029992
|
@ -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)) {
|
||||
|
|
|
@ -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', '');
|
||||
|
|
Loading…
Reference in a new issue