Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json metadata does not support serialize feature #391

Open
glebmikulko opened this issue Jan 16, 2020 · 1 comment
Open

Json metadata does not support serialize feature #391

glebmikulko opened this issue Jan 16, 2020 · 1 comment

Comments

@glebmikulko
Copy link

After initial gem setup with t.json :metadata, default: {} field I've got this error:

ActiveRecord::AttributeMethods::Serialization::ColumnNotSerializableError: Column `metadata` of type ActiveRecord::Type::Json does not support `serialize` feature.
Usually it means that you are trying to use `serialize`
on a column that already implements serialization natively.
from /home/gleb/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/attribute_methods/serialization.rb:74:in `block in serialize'

Environment:
Ruby 2.7.0
Rails 6.0.2.1
Postgres 11

@dferdian
Copy link

dferdian commented Feb 5, 2020

As per https://github.com/gocardless/statesman#using-postgresql-json-column, you need to remove the include Statesman::Adapters::ActiveRecordTransition statement from your transition model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants