forked from mastodon/mastodon
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change user settings to be stored in a more optimal way (mastodon#23630)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
- Loading branch information
Showing
36 changed files
with
818 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
class UserSettingsSerializer | ||
def self.load(value) | ||
json = begin | ||
if value.blank? | ||
{} | ||
else | ||
Oj.load(value, symbol_keys: true) | ||
end | ||
end | ||
|
||
UserSettings.new(json) | ||
end | ||
|
||
def self.dump(value) | ||
Oj.dump(value.as_json) | ||
end | ||
end |
Oops, something went wrong.