Skip to content

Release v4.0.2

Choose a tag to compare

@invoca-ruby-repos invoca-ruby-repos released this 29 May 18:43

Fixed

  • Fixed Rails 7.2 compatibility for the serialize: field option. Rails 7.2 changed
    serialize from a positional second argument to keyword-only (coder: / type:),
    causing an ArgumentError in any app using serialize: Array, serialize: Hash,
    serialize: JSON, or a custom coder. The fix branches on Rails version and uses
    the correct keyword API for Rails ≥ 7.2:
    • serialize: true → serialize(attr, coder: ::YAML)
    • serialize: Array / serialize: Hash → serialize(attr, coder: ::YAML, type: ClassName)
    • serialize: JSON → serialize(attr, coder: JSON)
    • serialize: MyCoder (custom coder) → serialize(attr, coder: MyCoder)
      Note: ::YAML is used explicitly rather than relying on default_column_serializer,
      which is nil by default in Rails 7.2 apps using load_defaults 7.2.