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

Open
wants to merge 1 commit into
base: next
Choose a base branch
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 changed the base branch from main to next May 30, 2024 08:14
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
1 participant