Skip to content

Rails 7.1: ArgumentError: missing keyword: :coder If no default coder is configured, a coder must be provided to serialize. #667

@sjieg

Description

@sjieg

Describe the bug

After upgrading to Rails 7.1 with configurations, starting rails with show this error:

/gems/ruby-3.3.4/gems/activerecord-7.1.3.4/lib/active_record/attribute_methods/serialization.rb:208:in `serialize': missing keyword: :coder If no default coder is configured, a coder must be provided to `serialize`. (ArgumentError)

To Reproduce

  1. Upgrade to Rails 7.1
  2. Use rpush 7.0.1
  3. See error

Expected behavior
Error not to happen

Logs and other output

Can come with a whole backtrace, but the issue lays with serialization.rb:208. I'll come with a PR to fix this.

System configuration (please complete the following information):

  • OS: Windows
  • OS version: 11
  • Ruby version: 3.3.4
  • Rails version: 7.1
  • Rpush version: 7.0.1

Additional context

https://guides.rubyonrails.org/configuring.html#config-active-record-default-column-serializer
Rails 7.1 default_column_serializer defaults to nil in 7.1, forcing to specify the serializer.

Rails.application.config.active_record.default_column_serializer = nil

This makes it best practise to add coder: YAML to every model with a serializer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions