Skip to content

Add Rails 7.2+ support#7

Open
JoeDupuis wants to merge 3 commits into
masterfrom
rails-7-2-support
Open

Add Rails 7.2+ support#7
JoeDupuis wants to merge 3 commits into
masterfrom
rails-7-2-support

Conversation

@JoeDupuis
Copy link
Copy Markdown
Member

@JoeDupuis JoeDupuis commented Jan 16, 2026

Summary

  • Update serialize API to use Rails 7.1+ keyword argument syntax (coder:, type:)
  • Replace deprecated update_attributes/update_attributes! with update/update! in tests

Rails 7.1 and earlier are now EOL, so this gem should targets Rails 7.2+.

- Update serialize API to use Rails 7.1+ keyword argument syntax
- Replace deprecated update_attributes/update_attributes! with update/update!

Rails 7.1 and earlier are now EOL, so this gem now targets Rails 7.2+.
@cursor
Copy link
Copy Markdown

cursor Bot commented Jan 16, 2026

PR Summary

Medium Risk
Moderate risk because it changes ActiveRecord serialization configuration for persisted value data; behavior should be verified across supported Rails versions. Test updates are low risk but may hide behavioral differences if update_attributes semantics were relied on.

Overview
Adds new CI Gemfiles for activerecord ~> 7.1.0 and ~> 7.2.0.

Updates RailsProperties::PropertyObject to use the Rails 7.1+ serialize keyword-argument form (coder: YAML, type: Hash) while keeping the legacy serialize :value, Hash path for older ActiveRecord.

Bumps gem version to 3.5.0 and replaces deprecated update_attributes/update_attributes! calls with update/update! throughout specs.

Written by Cursor Bugbot for commit 5936b47. This will update automatically on new commits. Configure here.

@JoeDupuis JoeDupuis requested review from a team January 16, 2026 20:45
Comment thread lib/rails-properties/property_object.rb
@noelrappin
Copy link
Copy Markdown

Also needs a version bump

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.


serialize :value, Hash
if ActiveRecord.version >= Gem::Version.new('7.1')
serialize :value, coder: YAML, type: Hash
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing default value for serialize may return nil

High Severity

The new Rails 7.1+ serialize syntax serialize :value, coder: YAML, type: Hash may not provide the same default value behavior as the old serialize :value, Hash. In pre-7.1 Rails, YAMLColumn with a Hash class argument returns {} for nil database values. The new syntax with raw YAML coder and type: Hash may return nil instead, causing NoMethodError when code calls value[name] or value.delete(name), and failing the validation value.is_a? Hash. The default: {} option appears to be missing.

Fix in Cursor Fix in Web

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