Skip to content

chore(version): add configurations for rails {8.0, 8.1}, ruby 3.4 - #7

Merged
adi-herwana-nus merged 1 commit into
masterfrom
adi/upgrade-rails-8-1
Aug 1, 2026
Merged

chore(version): add configurations for rails {8.0, 8.1}, ruby 3.4#7
adi-herwana-nus merged 1 commit into
masterfrom
adi/upgrade-rails-8-1

Conversation

@adi-herwana-nus

Copy link
Copy Markdown

Summary

Brings the Coursemology fork up to Rails 8.0 / 8.1 support, aligned with our sister gems
(activerecord-userstamp, settings_on_rails), and fixes a latent #touch incompatibility. The
fork keeps its deliberate divergence from upstream (chaadow) — the custom non_cyclic_save
autosave — which is not changed here.

Full spec suite passes on AR 7.2 / 8.0 / 8.1 (95 examples, 0 failures each).

Changes

#touch(time:) fix (lib/active_record/acts_as/instance_methods.rb)

The override was def touch(*args) and dropped the Rails 6+ time: keyword. Rails' own deferred
touch flow (TouchLater#touch_deferred_attributes, run in before_committed! for
belongs_to … touch: true) calls touch(time:), so the override mis-read the {time: …} hash as a
column name and raised ActiveModel::MissingAttributeError. Now def touch(*args, time: nil),
forwarding time: to both the submodel and the supermodel — mirroring upstream.

Rails 8 test matrix

  • Appraisals — replace rails-7.0 / rails-7.1 with rails-8.0 (~> 8.0.0) and
    rails-8.1 (~> 8.1.0); keep rails-7.2 (~> 7.2.0). Gemfiles regenerated.
  • .github/workflows/ruby.yml — matrix is now ruby 3.1–3.4 × activerecord 7.2 / 8.0 / 8.1,
    excluding ruby 3.1 on Rails 8 (Rails 8 needs Ruby ≥ 3.2).

Gemspec (active_record-acts_as.gemspec)

  • sqlite3 dev dependency ~> 1.7>= 2.1 (Rails 8 needs sqlite3 2.x).
  • Removed the psych 3.3.2 pin — it conflicts with the psych bundled in modern Ruby and blocked the
    bundle on Ruby 3.3+.
  • required_ruby_version >= 3.0>= 3.1; activesupport / activerecord >= 7.0
    >= 7.2 (drops the untested 7.0/7.1 line, matching the sister gems).
  • Fixed the polymorphic typo and pointed homepage at the Coursemology fork.

Version

4.0.14.1.0 (minor: new Rails 8 support + touch fix, no breaking API change).

Deliberately NOT changed

Upstream (v5.x) replaced the custom Autosave / non_cyclic_save module with Rails-native
autosave: true associations. This fork's non_cyclic_save is an intentional Coursemology
divergence (f054dff, 234301b) and passes cleanly on Rails 8.1, so it is kept as-is. Adopting
upstream's refactor would revert that fix and is out of scope for this PR.

Verification

rails-7.2 → AR 7.2.3.2 → 95 examples, 0 failures
rails-8.0 → AR 8.0.5.1 → 95 examples, 0 failures
rails-8.1 → AR 8.1.3.1 → 95 examples, 0 failures

Suggested commit message

feat: support Rails 8.0/8.1, fix #touch(time:) (v4.1.0)

- touch: accept the Rails 6+ `time:` kwarg and forward it to sub/supermodel,
  fixing ActiveModel::MissingAttributeError from the belongs_to(touch: true)
  deferred-touch flow; add a regression test
- appraisals/CI: test AR 7.2/8.0/8.1 on Ruby 3.1–3.4 (drop 7.0/7.1)
- gemspec: sqlite3 >= 2.1, activerecord/activesupport >= 7.2, ruby >= 3.1,
  drop the psych 3.3.2 pin
- bump version to 4.1.0

Keeps the fork's custom non_cyclic_save autosave (not upstream's refactor).

- fix latent issue with touch instance_method
@adi-herwana-nus
adi-herwana-nus merged commit eb6a5fa into master Aug 1, 2026
10 checks passed
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.

1 participant