thoughtbot / thoughtbot/administrate
Field::Polymorphic in form causing form page to take very long to load
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
I have a model Review which has a Field::Polymorphic Reviewable.
When I try to access the form page through new/edit, it takes very long to load due to the form loading every instance of a reviewable object.
Is there anyway to prevent the loading of all instance of the polymorphic class?
Alternatively is there a way I can have 'helper attributes' that do not exist in the model, but are used to determine the id of the polymorphic field?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Field::Polymorphic from the form page described in the issue and identify where every reviewable instance is loaded during new/edit. Determine how the field should avoid loading all instances or support helper attributes, then verify that the form remains usable without eagerly loading the full polymorphic collection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- backend, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100