ernie/meta_search — Issue #82: All records loaded by default
Author: pch
Created: 2011-12-09 12:03:29+00:00
State: open

I've run into an issue with the last version of meta_search. Controller:

```ruby
@search = Website.search(params[:search]) # Search params are empty
```

This results in:

```sql
SELECT `websites`.* FROM `websites`
```

When I add some chaining to the controller code:

```ruby
@search = Website.search(params[:search])
@websites = @search.paginate(:page => params[:page], :per_page => params[:per_page] || 10)
```

2 queries are executed:

```ruby
SELECT `websites`.* FROM `websites` LIMIT 10 OFFSET 0
SELECT `websites`.* FROM `websites`
```

Shouldn't it use lazy loading and execute just 1 query?