title: Rails Observer Not Working
body: <p>I am trying to use observers in my rails app to create a new entry in my "Events" Model every time a new "Comment" is saved. The comments are saving fine, but the observer is not creating events properly.</p>
  
  <pre><code>// comment_observer.rb
  class CommentObserver &lt; ActiveRecord::Observer
    observe :comment
  
    def after_save(comment)
      event = comment.user.events.create
      event.kind = "comment"
      event.data = { "comment_message" =&gt; "#{comment.message}" }
      event.save!
    end
  </code></pre>
  
  <p>This observer works great I use it in the console but it doesn't seem to be observing properly; when I try my app it just doesn't seem to create events. I don't see errors or anything.</p>
  
  <p>Also I have  <code>config.active_record.observers = :comment_observer</code> in my environment.rb file.</p>
  
  <p>Where am I going wrong? Should I be taking a different approach?</p>