mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 12:42:16 +08:00
FIX: Allow Symbol objects to be deserialized in PostRevision (#17510)
Followup to ee07f6da7d
This commit is contained in:
parent
7cf95e6339
commit
f774083016
|
@ -102,7 +102,7 @@ module Discourse
|
|||
config.action_controller.forgery_protection_origin_check = false
|
||||
config.active_record.belongs_to_required_by_default = false
|
||||
config.active_record.legacy_connection_handling = true
|
||||
config.active_record.yaml_column_permitted_classes = [Hash, HashWithIndifferentAccess, Time]
|
||||
config.active_record.yaml_column_permitted_classes = [Hash, HashWithIndifferentAccess, Time, Symbol]
|
||||
|
||||
# we skip it cause we configure it in the initializer
|
||||
# the railtie for message_bus would insert it in the
|
||||
|
|
|
@ -23,4 +23,15 @@ describe PostRevision do
|
|||
}
|
||||
)
|
||||
end
|
||||
|
||||
it "can serialize and deserialize symbols" do
|
||||
# Plugins may store symbolized values in this column
|
||||
pr = Fabricate(:post_revision, modifications: { key: :value })
|
||||
pr.reload
|
||||
expect(pr.modifications).to eq(
|
||||
{
|
||||
key: :value
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user