Observer question

./script/generate observer Account

does not work at all:

Couldn’t find ‘observer’ generator

What do I need to generate an observer?


Jochen

think you have to be on Edge to use that generator…

It’s currently only in Edge… however, you can make the observer
manually:

app/models/account_observer.rb:

class AccountObserver < ActiveRecord::Observer
end

test/unit/account_observer_test.rb:

require File.dirname(FILE) + ‘/…/test_helper’
class AccountObserverTest < Test::Unit::TestCase
fixtures :accounts
# Replace this with your real tests.
def test_truth
assert true
end
end

That’s exactly what the generator would output for that command. It’s
not that much, really :slight_smile: