[jifty-devel] Clauses are AND'd by default in the limit method?

Agent Zhang agentzh at gmail.com
Tue Dec 5 03:01:04 EST 2006


The Jifty::Manual::Models document contains the following snippet:

    # combining restrictions with "AND"
    # note that "AND" is implicit here
    $collection->limit(column=>'col1', value=>'...');
    $collection->limit(column=>'col2', value=>'...');

While testing my Qooqle app in Jifty, however, I found "OR" is
implicit here instead. By further examining the source of
Jifty::DBI::Collection, I've seen the following lines:

sub limit {
    my $self = shift;
    my %args = (
        table            => $self->table,
        column           => undef,
        value            => undef,
        alias            => undef,
        quote_value      => 1,
        entry_aggregator => 'or',
        case_sensitive   => undef,
        operator         => '=',
        subclause        => undef,
        leftjoin         => undef,
        @_    # get the real argumentlist

Apparently entry_aggregator defaults to "OR" according to the implementation.

Then which one is incorrect? The implementation or the documentation?


More information about the jifty-devel mailing list