FIX: Pass values of objects typed settings to theme migrations (#26751)

This commit fixes a bug in theme settings migrations where values of `objects` typed theme settings aren't passed to migrations even when there are overriding values for those settings. What causes this bug is that, when creating the hash that contains all the overridden settings and will be passed to migrations, the values of `objects` typed settings are incorrectly retrieved from the `value` column (which is always nil for `objects` type) instead of `json_value`. `objects` settings are different from all other types in that they store their values in the `json_value` column and they need to be special-cased when retrieving their values.
This commit is contained in:
Osama Sayegh
2024-04-25 16:39:22 +03:00
committed by GitHub
parent 9d3ab91517
commit 2215fa0c8e
3 changed files with 63 additions and 1 deletions

View File

@ -1,6 +1,10 @@
# frozen_string_literal: true
class ThemeSettingsManager::Objects < ThemeSettingsManager
def self.extract_value_from_row(row)
row.json_value
end
def value
has_record? ? db_record.json_value : default.map!(&:deep_stringify_keys)
end