jamierumbelow/codeigniter-base-model — pull request #68 by JoseTomasTocino (2012-10-21 22:23:42+00:00)
Title: Fix for the `_with` array not being properly reset after pull request #60

For the [Issue #58](https://github.com/jamierumbelow/codeigniter-base-model/issues/58) and its associated [pull request ](https://github.com/jamierumbelow/codeigniter-base-model/pull/60), the proposed solution works well for a single call, but it fails for consecutive calls.

As I said in the comments, you should move the reset of the `_with` array to the end of every `get*` function, because right now the behavior is not correct. Suppose an `author_book` table with two `belongs_to` relationships. For the following code:

var_dump($this->author_book->with('book')->get_all());
var_dump($this->author_book->with('author')->get_all());

The first line works ok, the second one returns the information of both the `book` and the `author` when it should only fetch the information for the `author`.