On Oct 24, 12:03 am, Clive Crous <[email protected]> wrote:
> Thanks Jeremy and sfrerik for your clarifications to my query.
>
> Having thought about this a bit myself now this would indeed be quite
> useful especially in scaffolding-like scenarios.
>
> My instincts keep saying the fast-failure is "better" but after some
> more thought on the matter it certainly seems like in practice it
> makes a lot more sense to simply return an empty array.
> If one were to insist on it throwing an error then surely, to keep
> consistency, it should also raise an error when attempting to access `
> album.id ` etc before a save and that just seems completely
> impractical and silly.
>
> I retract my original view. I'm all for this change.
>
> Thanks,
> Clive

I really should pay more attention.  I changed the behavior to do
exactly what we just agreed on decided on back on October 5th (http://
github.com/jeremyevans/sequel/commit/
26873355eee2550178f5877856a352bd72fb5cf0). :)

My reasoning then had to do with correct behavior when not using real
primary keys, whether or not the object was saved was
inconsequential.  If you need the key value and it wasn't available,
the code would have used NULL instead, which resulted in incorrect
behavior.

Now, in the regular case, you are using real autogenerated primary
keys, so they don't have values until after the object is saved.
That's the case we were discussing, but it was just a subset of the
problem I fixed back on October 5th.

So I'd like to apologize for wasting people's time.  Let this be a
reminder to all of us to always test against HEAD before proposing
changes. :)

Mea culpa,
Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to