Skip to content

Rails 8 support #2488

@JensDebergh

Description

@JensDebergh

Hi everyone!

I know this library isn't actively developed anymore, but I'm using this on an app with over 100 records and controllers, so I can't just swap it out easily.

Currently I'm in the progress of upgrading to rails 8 and stumbled on following error:

FrozenError - can't modify frozen Hash: {serialization_context: #<ActiveModelSerializers::SerializationContext:0x000000015713c808 @request_url="http://localhost:3000/api/calendar", @query_parameters={"start" => "2025-02-18T23:00:00.000Z", "end" => "2025-02-19T22:59:59.999Z"}, @url_helpers=#<Module:0x00000001412b8990>, @default_url_options={host: "localhost:3000"}>, namespace: Api}:
  app/controllers/api/calendar_controller.rb:282:in `index'

Rails 8 got more strict with frozen hashes and it seems activemodel serializer tries to modify a hash that was originally frozen.

If anyone could point me in the right direction, I would be happy to wip up a merge request to fix the issue for rails 8 users to atleast get it in a workable state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions