Skip to content
This repository was archived by the owner on Sep 14, 2021. It is now read-only.
This repository was archived by the owner on Sep 14, 2021. It is now read-only.

Validations for booleans #2

@ghost

Description

I had another though for an addition in your library.
I'm sorry that i haven't had found time to fork your repo to make an example but here goes anyhow.

There should be way to validate if any of the possible options where checked.
Not sure how the syntax would be, perhaps something like validates_accepted_any :fieldname ?

And the implementation would be pretty much like @booleans_data.reject { |k, v| k.blank? || !v[1] }.any? So it would filter out any keys that are nil, or which boolean value is in FALSE_VALUES.

Dunno if this makes sense, just something i needed in one project :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions