Ensure consistent behavior in ActiveRecord::afterSave()

fixes #4012
Merge PR #4038 branch 'consistent-after-save'

* consistent-after-save:
  use an AfterSaveEvent class to be consistent
  fixed test break and wrong parameter
  changed updateAttributes to be more simple update
  Ensure consistent behavior in ActiveRecord::afterSave()

Conflicts:
	framework/UPGRADE.md