Callback question

2 views
Skip to first unread message

Mike

unread,
Apr 3, 2009, 1:58:18 PM4/3/09
to ColdFusion on Wheels
I'm using callbacks in developing user authentication capabilities in
my application and had a question about the various callback methods.
What is the difference between beforeSave() and beforeUpdate()? I
expected one to fire with a method call to save() and the other to
fire will a method call to updateXXX() methods. However, even though
I was calling an update method, the beforeSave() callback was
executing. When I read the wiki, the implication is that an update
callback would only execute when an update method is called. What am
I missing?

Thanks,

Mike

Per Djurner

unread,
Apr 3, 2009, 2:07:40 PM4/3/09
to cfwh...@googlegroups.com
beforeUpdate is called before an existing record is updated.
beforeCreate is called before a new record is created.

beforeSave is always called (regardless of whether it's a new record or an existing one).

Makes sense?

Mike

unread,
Apr 3, 2009, 2:52:16 PM4/3/09
to ColdFusion on Wheels
Yep. Good thing I recoded to work with beforeCreate() then!

On Apr 3, 2:07 pm, Per Djurner <per.djur...@gmail.com> wrote:
> beforeUpdate is called before an existing record is updated.beforeCreate is
Reply all
Reply to author
Forward
0 new messages