Merge pull request #208 from mailpoet/listing_tests

Listings
This commit is contained in:
Marco
2015-11-10 10:39:53 +01:00
16 changed files with 176 additions and 94 deletions

View File

@@ -68,7 +68,7 @@ class Segment extends Model {
}
static function search($orm, $search = '') {
return $orm->where_like('name', '%'.$search.'%');
return $orm->whereLike('name', '%'.$search.'%');
}
static function groups() {
@@ -76,12 +76,12 @@ class Segment extends Model {
array(
'name' => 'all',
'label' => __('All'),
'count' => Segment::whereNull('deleted_at')->count()
'count' => Segment::getPublished()->count()
),
array(
'name' => 'trash',
'label' => __('Trash'),
'count' => Segment::whereNotNull('deleted_at')->count()
'count' => Segment::getTrashed()->count()
)
);
}