On Oct 30, 8:59 pm, Phrogz <[EMAIL PROTECTED]> wrote:
> I'm having a problem with an app I wrote that I'm running in beta. I
> have database entries in Model B being created in an after_create and
> a before_save hook in Model A.
>
> Sometimes I'm getting two identical rows being created. I'm trying to
> figure out if this is Sequel or...what.

Followup: tmm1 on #ramaze provided the excellent insight into this
problem. It's a combination of me having an anonymous hook and Ramaze
being able to reload the source on the fly in the same process, thus
registering the hook additional times.

For more details see the followup on the thread above.

This information is already covered in the docs for Sequel::Model:
"If the tag is not nil, it will overwrite a previous block with the
same tag. This allows hooks to work with systems that reload code."

I suggest that the example of the hooks shown in the README should
have tags on them just to help others blindly copying the pattern as I
did not run into this, even if they don't understand why. If I get
time, I'll submit a doc patch to that effect.
--~--~---------~--~----~------------~-------~--~----~
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