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

fix unexpected behavior around filters with validators #575

Closed
wants to merge 1 commit into from

Conversation

mogman1
Copy link

@mogman1 mogman1 commented May 30, 2024

Fixes #574

In my first example from that issue, the problem is that in the overridden run_validations! method, it doesn't end by calling errors.empty? the way that the Rails Validations class method does.

def run_validations!
  _run_validate_callbacks
  errors.empty?
end

In my second example, the issue is that on initialization @_interaction_inputs is set based on the original values sent over. Since nothing is being set, and there's no default value, it becomes nil. However, as updates are made to the filter value, nothing ever updates that original mapping so it will always fail. I went back and forth on how to address this, considering a callback to update the Input definition, but that didn't seem necessary when I had the actual context available. I also considered removing the now-unused inputs param, but didn't want to force an API change on you.

@mogman1 mogman1 force-pushed the fix_required_behavior branch from e8b0cc9 to 1ccacb1 Compare May 30, 2024 08:12
@mogman1 mogman1 changed the base branch from main to next May 30, 2024 08:14
@mogman1 mogman1 force-pushed the fix_required_behavior branch from 1ccacb1 to dde6efb Compare May 30, 2024 08:15
@AaronLasseigne AaronLasseigne deleted the branch AaronLasseigne:next November 17, 2024 22:48
@mogman1
Copy link
Author

mogman1 commented Nov 17, 2024

Is there something I could do to improve this PR?

@mogman1
Copy link
Author

mogman1 commented Nov 17, 2024

It looks like this was closed due to you deleting the next branch. I attached my PR to that branch per your contribution guidelines. Perhaps I should target a different branch?

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.

Unexpected validation behavior on filters with validators
2 participants