apsislabs / apsislabs/phi_attrs

Rails 7 - Potential Select Attribute Behavior Change

Open
#61 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
31
Forks
3
PR merge metrics
No merged PRs in 30d

Description

> There is a bug/unlisted deprecation in Rails 7 regarding .select and how it creates attribute reflections for fields. To fix Add a `has_attribute?` check to anything acting on `after_initialize` will need to have these for us to be able to use `.select`.

Example:
`if has_attribute?(:foo) && foo.blank?`

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the model callbacks that act during after_initialize and trace how they behave when Rails 7 uses .select with a partial attribute set. Check the repository's existing tests around initialization and selected fields; done means these callbacks safely handle missing attributes while preserving normal initialization behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.