Skip to content

MariaDB and context serialization #90

@multiscan

Description

@multiscan

Hello,

on my app that uses mariadb as database, I get an exception in the 'errors#show' view because the occurrence object used as occurrence.context&.each (file: app/views/solid_errors/occurrences/_occurence.html.erb) which is supposed to be an Hash turns out to be a string.
I fixed this by just adding serialize :context, coder: JSON in the Occurrence model definition but I am wandering if this is the correct way of doing it and why this is not necessary when using sqlite as proposed by default. Is there a better way to force json encoding into a column than the serialize directive ?
I will now try to see if my added line brakes a newly created app with sqlite. If it does not, I will probably submit a PR (although it is just a one liner).
Thank you very much for your comment.
Best,
giovanni

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions