3 class Comment
< ActiveRecord
::Base
6 before_validation
:record_callers
13 callers
<< self.class if callers
17 class CommentObserver
< ActiveRecord
::Observer
18 attr_accessor
:callers
20 def after_validation(model
)
21 callers
<< self.class if callers
25 class CallbacksObserversTest
< ActiveRecord
::TestCase
26 def test_model_callbacks_fire_before_observers_are_notified
30 comment
.callers
= callers
32 CommentObserver
.instance
.callers
= callers
36 assert_equal
[Comment
, Comment
, CommentObserver
], callers
, "model callbacks did not fire before observers were notified"