Commit 0fff59ce authored by Valery Sizov's avatar Valery Sizov Committed by Michael Kozono

Apply suggestion to...

Apply suggestion to ee/changelogs/unreleased/215616-geo-synchronisation-status-is-empty-when-nothing-is-synchronised.yml
parent 1468db1d
......@@ -158,7 +158,7 @@ class GeoNodeStatus < ApplicationRecord
def self.alternative_status_store_accessor(attr_names)
attr_names.each do |attr_name|
define_method(attr_name) do
status[attr_name] || read_attribute(attr_name)
status[attr_name].nil? ? read_attribute(attr_name) : status[attr_name].to_i
end
define_method("#{attr_name}=") do |val|
......
---
title: 'Geo: Fix empty synchronisation status when nothing is synchronised'
merge_request: 30710
author:
type: fixed
......@@ -1332,5 +1332,13 @@ describe GeoNodeStatus, :geo, :geo_fdw do
end
end
end
context 'status counters are converted into integers' do
it 'returns integer value' do
subject.status = { "projects_count" => "10" }
expect(subject.projects_count).to eq 10
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment