Skip to content

Rails 8.1 - #112

Open
skunkworker wants to merge 9 commits into
liveh2o:mainfrom
skunkworker:rails_8_1
Open

skunkworker wants to merge 9 commits into
liveh2o:mainfrom
skunkworker:rails_8_1

Conversation

@skunkworker

@skunkworker skunkworker commented Jul 24, 2026 •

Copy link
Copy Markdown
Collaborator

Rails 8.1 support.

skunkworker and others added 4 commits July 21, 2026 10:02
Pin activemodel/activesupport to ~> 8.0.0, following the branch
convention of tracking a single Rails version instead of using
Appraisal to span multiple versions.

- Bump gem version to 8.0.0 (shadows Rails 8.0)
- Require Ruby 3.2 (to match Rails 8.0)
- Replace deprecated public_instance_methods.include? stub with
  public_method_defined? in association specs
- Simplify CI to a single-version test matrix (no Appraisal)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pin activemodel/activesupport to ~> 8.1.0, following the branch
convention of tracking a single Rails version instead of using
Appraisal to span multiple versions.

- Bump gem version to 8.1.0 (shadows Rails 8.1)
- Require Ruby 3.2 (to match Rails 8.1)
- Replace deprecated public_instance_methods.include? stub with
  public_method_defined? in association specs
- Simplify CI to a single-version test matrix (no Appraisal)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the class-level `@attribute_names ||=` memoization; it had no
invalidation hook, so attributes declared after the first call went
missing. Delegate to ActiveModel's already-invalidated `attribute_types`
(matching upstream ActiveModel's own implementation).

Add specs guarding the :value type registration and the protobuf
serializer's :value fallback, plus negative-path coverage ([]= on
unknown attribute, empty-collection query, readonly update_attribute).
Harden the shared-mutable-default spec to use a throwaway class so it
can't pollute shared fixture state.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@skunkworker

Copy link
Copy Markdown
Collaborator Author

@liveh2o could we get a RC release of this?

skunkworker and others added 5 commits July 24, 2026 13:03
Splitting changes_applied into a #save snapshot and a conditional clear in
#remote left #save's comment describing a mechanism it no longer has, and
#instantiate undocumented while every sibling override was not.

Co-Authored-By: Claude <noreply@anthropic.com>
An audit of every comment in lib/ found roughly 30 that no longer described
the code. Three causes: prose copied from ActiveRecord that was never true
here (integration.rb's cache_versioning claims are the inverse of what
cache_key does, and its find examples raise), comments naming the wrong
method, and comments that rotted when the code moved on.

Two of the findings were not documentation problems. #attribute_for_inspect
took only string names while its #[] and #[]= siblings coerce, so a symbol
silently reported "nil" -- it now delegates to #[]. And .attr_publishable
lost its only consumers when publication and the JSON serializer were removed
in 3.0.0, leaving an inert macro; it is gone.

Co-Authored-By: Claude <noreply@anthropic.com>
The association reader resolved the associated class before checking its own
cache, so #classify ran the uncached inflector on every read -- 8us and 9
allocations to return a value already in an ivar. The cache check moves first.
One consequence worth naming: validate_scoped_attributes now runs on the first
read per instance rather than every read.

build_from_rpc overwrites every slot it dups, so deep_dup there was pure waste
on the per-record deserialization path; a shallow dup is enough. The dup in
merge_attributes_from_rpc stays -- the mutation tracker holds the attribute set
by reference, so replacing it is what makes #previous_changes work.

#delete and #destroy had drifted into byte-identical bodies, which this branch
made worse by adding the same errors.clear line to each; they now share a
private remote_delete(endpoint).

The adapter spec's hand-rolled failing client is replaced by mock_rpc from
protobuf-rspec, already included in every example group. Verified the
misnamed-constant mutation still produces the same 6 failures.

Co-Authored-By: Claude <noreply@anthropic.com>
@liveh2o

liveh2o commented Aug 19, 2026

Copy link
Copy Markdown
Owner

This pull request is quite large, so it's taking longer than anticipated to review. In the meantime, all of the specs pass with Active Model 8.1, so I've cut an alpha version (8.1.0.alpha) that can be used to start testing.

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