Project

General

Profile

Actions

Bug #35894

closed

Foreman.settings.load_values is not able to pick settings which transitioned from a non-default to default value

Added by Adam Ruzicka almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Settings
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

When a setting is set back to its default value, the value persisted in DB is `nil` to denominate that the default value should be used. However, the setting registry only looks at settings with non-nil values so it never picks up the nondefault->default transition.

Steps to reproduce:
1) Run rails console
2) Pick a $setting without custom value
3) Read a value of $setting with Setting[$setting]
4) In another process, change the value of $setting to a non-default one
5) Reload the settings with Foreman.settings.load_values
6) Repeat 3, notice the value is what was set in 4
6) In another process, change the value of $setting to the default one
7) Repeat 5
8) Repeat 3

Actual results:
The value in 8 is the same as in 6

Expected results:
The value in 8 is the same as in 3

Actions

Also available in: Atom PDF