The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DBIx::Class::Helper::ResultSet::BooleanMethods - Automatically create search methods for boolean columns.

VERSION

Version 0.05

SYNOPSIS

This module automatically creates search method helpers for boolean columns.

In your ResultSet class, add:

    use Role::Tiny::With qw(with);
    use DBIx::Class::Helper::ResultSet::BooleanMethods;

    with(BooleanMethods(__PACKAGE__));

METHODS

Say your table has a boolean column named "paid", using this role will act as if you added these methods:

    sub paid {
        my $self = shift;
    
        return $self->search(
                {
                        'paid' => 'true',
                }
        );
    };
    
    sub not_paid {
        my $self = shift;
    
        return $self->search(
                {
                        'paid' => 'false',
                }
        );
    };

AUTHOR

Mathieu Arnold, <mat at cpan.org>

BUGS

Please report any bugs or feature requests to bug-dbix-class-helper-resultset-booleanmethods at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Class-Helper-ResultSet-BooleanMethods. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc DBIx::Class::Helper::ResultSet::BooleanMethods

You can also look for information at:

ACKNOWLEDGEMENTS

Thanks to the people of #dbix-class, they were very helpful in pointing me to the right direction.

LICENSE AND COPYRIGHT

This software is Copyright (c) 2019 by Mathieu Arnold.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)