Commit d59c866b authored by Michael Kozono's avatar Michael Kozono

Merge branch...

Merge branch '215616-geo-synchronisation-status-is-empty-when-nothing-is-synchronised' into 'master'

Geo: Fix empty synchronisation status when nothing is synchronised

Closes #215616

See merge request gitlab-org/gitlab!30710
parents 9056f109 0fff59ce
......@@ -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