Skip to content

We can't extract Associated Objects from methods ending in ? or =.#42

Merged
kaspth merged 1 commit intomainfrom
fix-generalize-method-proxying
Aug 10, 2025
Merged

We can't extract Associated Objects from methods ending in ? or =.#42
kaspth merged 1 commit intomainfrom
fix-generalize-method-proxying

Conversation

@kaspth
Copy link
Owner

@kaspth kaspth commented Aug 10, 2025

Our method_missing based proxying is technically eager to hopefully allow us to support more of Active Record's surface area cheaply. It's been working well for over 3 years, but there's some issues.

Notably, a record.respond_to? check is not enough and there's certain methods we don't want to proxy.

Stuff like Active Record's class-level configuration API via abtract_class?, descends_from_active_record?, abstract_class= and primary_abstract_class= to name a few.

So ideally opting out of proxying methods that end in ? and = should be safe.

I'm not including ! to allow find_by! to work.

Ref: rubyevents/rubyevents#873
Ref: #40

Our `method_missing` based proxying is technically eager to hopefully allow us to support more of Active Record's surface area cheaply. It's been working well for over 3 years, but there's some issues.

Notably, a `record.respond_to?` check is not enough and there's certain methods we don't want to proxy.

Stuff like Active Record's class-level configuration API via `abtract_class?`, `descends_from_active_record?`, `abstract_class=` and `primary_abstract_class=` to name a few.

So ideally opting out of proxying methods that end in `?` and `=` should be safe.

I'm not including `!` to allow `find_by!` to work.

Ref: rubyevents/rubyevents#873
@kaspth kaspth self-assigned this Aug 10, 2025
@kaspth kaspth merged commit f27372a into main Aug 10, 2025
2 checks passed
@kaspth kaspth deleted the fix-generalize-method-proxying branch August 10, 2025 17:39
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