Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-1023

model#previous_changes is not handed to Mongoid::Observer (commit 26dec02b1)

    • Type: Icon: Task Task
    • Resolution: Done
    • 2.1.0
    • Affects Version/s: None
    • Component/s: None

      Hi, say I have a User model with an active observer:

      class UserObserver < Mongoid::Observer
      def after_update(user)
      Rails.logger.info(">> #

      {user.previous_changes}

      ")

      when I update a user:

      ruby-1.9.2-p180 :005 > u01.name = 'ABCDEF'
      => "ABCDEF"
      ruby-1.9.2-p180 :006 > u01.save
      => true

      Then Rails loggs only '>>', so the previous_changes hash doesn't make it through to the observer.
      This happens at least in commit 26dec02b1.
      --Frank

            Assignee:
            durran Durran Jordan
            Reporter:
            fwoeck fwoeck
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: