Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tableless models to not rely on fake schema loading #17238

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

klaustopher
Copy link
Contributor

@klaustopher klaustopher commented Nov 20, 2024

Ticket

Part of https://community.openproject.org/projects/openproject/work_packages/57304

What are you trying to accomplish?

In Rails 7.2 the internal attributes_to_define_after_schema_loads method has been removed and as it was considered internal only, it is not planned to be replaced. We rely on that method to hook into the schema loading of our fake Tableless models by manually attaching attributes and overwriting the column cache for it.

We can achieve the same thing, by directly defining the attributes and completely skipping the schema loading by making load_schema! a no-op and manually creating a column cache.

It has been extracted from #17228 as there are more things that block the upgrade to Rails 7.2, but we can already do this here to validate with all tests that the tableless models still work as intended.

Screenshots

What approach did you choose and why?

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant