Created
January 18, 2017 08:58
-
-
Save mrenvoize/4f55301453261c7c4c3741de23ae06e6 to your computer and use it in GitHub Desktop.
Boolean Filter for DBIx::Class Result Object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head1 FILTERED COLUMNS | |
=head2 suppressed | |
Type: Boolean | |
=cut | |
__PACKAGE__->filter_column( | |
suppressed => { | |
filter_to_storage => sub { $_[1] ? 1 : 0 }, | |
filter_from_storage => sub { $_[1] ? Mojo::JSON->true : Mojo::JSON->false } | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment