Forum: Ruby on Rails before_create firing twice on a save - RC2

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
11ba36dcbe955d1f2c4111de906134c4?d=identicon&s=25 Lori Olson (Guest)
on 2007-01-08 19:47
(Received via mailing list)
I have a unit test which fails using Rails 1.2RC2, because a method
by the before_create filter is firing twice when my ActiveRecord is
Is a before_create filter supposed to cause multiple invocations?  We
assumed it is called once, and only once, when the object is created, in
code (but we unit tested it to make certain).

This is one of three issues I have with my unit tests on RC2.  I'll post
separately for the other two, when I've done more research on those.

Regards, Lori
11ba36dcbe955d1f2c4111de906134c4?d=identicon&s=25 Lori Olson (Guest)
on 2007-01-15 20:13
(Received via mailing list)
So, doesn't anyone have anything to say about the semantics of
before_create?  Is it, or is not, valid for the before_create filter to
558a1355cd9f2584c80afdd92ec984d2?d=identicon&s=25 Shauna (Guest)
on 2007-01-16 02:26
Lori, can you give more details?

For example, what is the test that is failing, and its context? Can you
also include what you think are the relevant lines from the controller?
Can you include the part of the test.log that is relevant?
This topic is locked and can not be replied to.