bllim/laravel4-datatables-package — pull request #95 by reneweteling (2014-04-15 09:14:01+00:00)
Title:  Postgress cast statement incorrect

Hey there,

On Datatables.php:403 you have this
```
if( DB::getDriverName() === 'pgsql') {
$cast_begin = "CAST(";
$cast_end = " as TEXT)";
}
```

only this results in postress errors when you have a column defined like table.field.
```
select count(*) as aggregate from (select '1' as row from "user" inner join "user_role" on "user"."id" = "user_role"."user_id" where "user"."deleted_at" is null and "user_role"."office_id" = $1 and "role_id" = $2 and (CAST(user.givenname as TEXT) LIKE $3 or CAST(insertions as TEXT) LIKE $4 or CAST(surname as TEXT) LIKE $5 or CAST(email as TEXT) LIKE $6)) AS count_row_table
```
if you add come quotes all is well like this

```
if( DB::getDriverName() === 'pgsql') {
$cast_begin = "CAST('";
$cast_end = "' as TEXT)";
}
```

Thanks!