luckyframework / luckyframework/avram

Polymorphic preloads don't work the same as other ones

Open
#1,035 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug hacktoberfest
Dominant language
Crystal
Stars
183
Forks
67
PR merge metrics
No merged PRs in 30d

Description

https://github.com/luckyframework/avram/blob/bc2ad7b2da0093bb8e81a2de66e0c16057eea740/src/avram/polymorphic.cr#L160-L163

Normal preloads allow you to pass a block, or override the BaseQuery, but the polymorphic preloads are missing those overloads

https://github.com/luckyframework/avram/blob/bc2ad7b2da0093bb8e81a2de66e0c16057eea740/src/avram/associations/has_many.cr#L170

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the polymorphic preload implementation at src/avram/polymorphic.cr#L160-L163, then compare it with the preload overloads in src/avram/associations/has_many.cr#L170. Confirm how normal preloads accept a block and an overridden BaseQuery, and make the polymorphic preload API provide the same options.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal
Domain
backend, database
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.