Skip to content

Conversation

seanpdoyle
Copy link
Contributor

Follow-up to #420

Background

The introduction of ActiveResource::Base.coder and the ActiveResource::Coder class added support for encoding and decoding instances of Base. The intent was to integrate with the Active Record .serialize method.

Problem

While the Coder class and Serialization module aim to comply with Active Record, there's still potential for that compatibility to drift of break without sufficient test coverage.

Proposal

This commit adds a test-only dependency on activerecord and sqlite3 so that the serialization test coverage can include database-level reads and writes. The suite is configured to use the in-memory SQLite adapter so that there are no need for migrations or external database configuration.

Follow-up to [rails#420][]

Background
---

The introduction of `ActiveResource::Base.coder` and the
`ActiveResource::Coder` class added support for encoding and decoding
instances of `Base`. The intent was to integrate with the Active Record
[.serialize][] method.

Problem
---

While the `Coder` class and `Serialization` module aim to comply with
Active Record, there's still potential for that compatibility to drift
of break without sufficient test coverage.

Proposal
---

This commit adds a test-only dependency on `activerecord` and `sqlite3`
so that the serialization test coverage can include database-level reads
and writes. The suite is configured to use the in-memory SQLite adapter
so that there are no need for migrations or external database
configuration.

[rails#420]: rails#420
[.serialize]: https://api.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html#method-i-serialize
@rafaelfranca rafaelfranca merged commit bd154d2 into rails:main Oct 1, 2025
19 checks passed
@seanpdoyle seanpdoyle deleted the coder-activerecord branch October 1, 2025 20:51
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

Successfully merging this pull request may close these issues.

2 participants