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

Skip args sanitizing for :for_template_promotion_id scope #12005

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mateus-po
Copy link
Contributor

The fix is related to this issue.

Ransack scope functions by default convert values that are included in those sets to pertinent boolean values:

    TRUE_VALUES = [true, 1, '1', 't', 'T', 'true', 'TRUE'].to_set
    FALSE_VALUES = [false, 0, '0', 'f', 'F', 'false', 'FALSE'].to_set

This is undesirable since integer 1 is correct value for :for_template_promotion_id and should be treated as such.

Setting self.ransackable_scopes_skip_sanitize_args prevents this conversion. It affects only true/false values conversion.

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.

None yet

1 participant