You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to limited volunteers, issues that do not follow this template will be
closed without comment.
Is your feature suggestion related to a problem? Please describe.
Currently, if the models use CarrierWave to save files they will lead to error while trying to save CarrierWave::Uploader::Base objects as changes
A clear and concise description of the problem. You may find the bug report template
helpful.
Describe the solution you'd like to build
My solution: I would like to adjust the method serialize_object_changes of Events::Base
A clear and concise description of what you want to build.
Describe alternatives you've considered
Currently, it's like below
module Events
class Base
private
def serialize_object_changes(changes)
AttributeSerializers::ObjectChangesAttribute.
new(@record.class).
serialize(changes)
# We'd like to convert this `HashWithIndifferentAccess` to a plain
# `Hash`, but we don't, to save memory.
changes
end
end
end
I would like to change:
module Events
class Base
private
def serialize_object_changes(changes)
changes = changes.transform_values do |values|
values.map do |value|
if value.is_a?(CarrierWave::Uploader::Base)
value.url
else
value
end
end
end
AttributeSerializers::ObjectChangesAttribute.
new(@record.class).
serialize(changes)
# We'd like to convert this `HashWithIndifferentAccess` to a plain
# `Hash`, but we don't, to save memory.
changes
end
end
end
The text was updated successfully, but these errors were encountered:
Thank you for your contribution!
Due to limited volunteers, issues that do not follow this template will be
closed without comment.
Is your feature suggestion related to a problem? Please describe.
A clear and concise description of the problem. You may find the
bug report template
helpful.
Describe the solution you'd like to build
serialize_object_changes
ofEvents::Base
A clear and concise description of what you want to build.
Describe alternatives you've considered
Currently, it's like below
I would like to change:
The text was updated successfully, but these errors were encountered: