This project is archived and is in readonly mode.

#6068 ✓resolved
Samuel Kadolph

Reloading in the console stops observer callbacks

Reported by Samuel Kadolph | November 25th, 2010 @ 09:06 PM

Calling reload! in the console stops all observer callbacks from being fired on new instances of records (old records in memory still work).

class GizmoObserver < ActiveRecord::Observer
  def after_save(gizmo)
    puts "after_save(#{gizmo})"

And now in a console:

$ rails c
Loading development environment (Rails 3.0.3)
ruby-1.9.2-p0 > (g = Gizmo.first).save
 => true
ruby-1.9.2-p0 > reload!
 => true
ruby-1.9.2-p0 >
 => true
ruby-1.9.2-p0 >
 => true

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>