jonathangeiger / kohana-jelly

See the link below for the most up-to-date code
https://github.com/creatoro/jelly
MIT License
146 stars 34 forks source link

Jelly_Builder::load() returns unloaded model when no parameter is supplied #132

Closed aron closed 14 years ago

aron commented 14 years ago

This was created in 7f6cb1, see ticket #120.

I'm not 100% sure returning a factory object is the correct behavior if no $key is passed in. I've been using this method to load a single row. It was working just fine until this update now I'm returned an unloaded model.

For example:

$user = Jelly::select('user')->where('name', '=', 'bill')->load();

Running this used to return a loaded user object (if the row existed in the DB). Now I get an empty model. Calling load() on a query builder should load the object. The old behaviour seems correct to me.

Cheers,

Aron

banks commented 14 years ago

Not sure if this was intended or not. Hopefully it will get sorted soon - we are both pretty busy!

aron commented 14 years ago

That's fine, I've just forked the repo and updated it here, aron@3ca2a3cf899d9afe998d286f41c357b599c55102. I sent you guys a pull request should you be interested.

Cheers,

Aron

jonathangeiger commented 14 years ago

Closed by 72456d507236ab2527473656369e3a39d7adada9. Thanks aron!