luckyframework / luckyframework/avram

Operation callbacks are missing the conditional arguments

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

Nobody has claimed this yet.

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

Description

https://github.com/luckyframework/avram/blob/bb63db88513b05e80030a4c61c9ef48b0ea12dbe/src/avram/callbacks.cr#L97C9-L97C19

With SaveOperation and DeleteOperation you can do before_save :do_thing, if: :valid?, but this doesn't work for before_run or after_run

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 src/avram/callbacks.cr at the linked line and compare how conditional arguments work for before_save with how before_run and after_run are handled. Confirm that the run callbacks accept conditions such as if: :valid?, then verify that both callbacks behave consistently with the save and delete callbacks.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.