Forum: Ruby on Rails observer doesn't react

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
NoobSaibot (Guest)
on 2006-04-06 15:23
i followed the observer documentation [1] and created, and registered an
observer. i had to realise that the observer doesn't work at all -- in
fact the rails application does not even start -- with acts_as_taggable,
for whatever reason.

i must admit that i'm still using ruby 1.8.2. however, after commenting
the acts_as_taggable instruction out the application runs smoothly as
always, though it doesn't log as expected.

i was logging as in the documentation [1]

def after_create(project)
  project.logger.info("new project created")
end

after that didn't work i tried to log the action into the database by
creating a log table and a model. after that was done i alterd the
after_create method to

def after_create(project)
  log = Log.new
  # set the attributes here
  ...
  log.save
end

after creating some projects i looked in the database with the
expectation to see some entries. there were no entries.

am i doing something wrong?

[1] http://api.rubyonrails.org/classes/ActiveRecord/Ob...
NoobSaibot (Guest)
on 2006-04-07 16:07
any ideas?
This topic is locked and can not be replied to.