discourse/lib/theme_settings_manager
Alan Guo Xiang Tan b1495884eb
PERF: Avoid saving ThemeSetting twice when creating new db override (#26076)
Why this change?

When creating a new theme setting that does not have a corresponding row
in the `theme_settings` table, we end up writing to the database twice
because `ActiveRecord::Base#save!` is called once before the `value`
or `json_value` column is updated again with another database query with
another call to `ActiveRecord::Base#save!`.

What does this change do?

Adds the column to be updated to argument for the `ActiveRecord::Base#create!`
method call so that we only have one write query to the database.
2024-03-07 16:38:11 +08:00
..
bool.rb
enum.rb
float.rb
integer.rb
list.rb
objects.rb PERF: Avoid saving ThemeSetting twice when creating new db override (#26076) 2024-03-07 16:38:11 +08:00
string.rb
upload.rb