View | Details | Raw Unified | Return to bug 21549
Collapse All | Expand All

(-)a/Koha/Objects.pm (-1 / +1 lines)
Lines 289-295 sub filter_by_last_update { Link Here
289
        $conditions->{'<='} = $dtf->format_date( $to );
289
        $conditions->{'<='} = $dtf->format_date( $to );
290
    }
290
    }
291
291
292
    return $self->_resultset->search(
292
    return $self->search(
293
        {
293
        {
294
            $timestamp_column_name => $conditions
294
            $timestamp_column_name => $conditions
295
        }
295
        }
(-)a/t/db_dependent/Koha/Objects.t (-1 / +4 lines)
Lines 1097-1102 subtest "filter_by_last_update" => sub { Link Here
1097
        );
1097
        );
1098
    };
1098
    };
1099
1099
1100
    my $filtered_patrons = $patrons->filter_by_last_update(
1101
        { timestamp_column_name => 'updated_on', days => 2 } );
1102
    is( ref($filtered_patrons), 'Koha::Patrons', 'filter_by_last_update must return a Koha::Objects-based object' );
1103
1100
    my $count = $patrons->filter_by_last_update(
1104
    my $count = $patrons->filter_by_last_update(
1101
        { timestamp_column_name => 'updated_on', days => 2 } )->count;
1105
        { timestamp_column_name => 'updated_on', days => 2 } )->count;
1102
    is( $count, 3, '3 patrons have been updated before the last 2 days (exclusive)' );
1106
    is( $count, 3, '3 patrons have been updated before the last 2 days (exclusive)' );
1103
- 

Return to bug 21549