æ¦è¦ â class CommentObserver < ActiveRecord::Observer def after_save(comment) Notifications.deliver_comment("[email protected]", "New comment was posted", comment) end end ã®ããã«Observerã¯ã©ã¹ãç¨æãã¦ããã ããã§ãComment#saveãå¼ã°ããã¨ã[email protected]ã«ã¡ã¼ã«ãé£ã¶ã â ã¯ã©ã¹åããç£è¦ããã¯ã©ã¹ã決å®ã§ããªãå ´å â observeã¡ã½ããã§æå®ããã class AuditObserver < ActiveRecord::Observer observe Account def after_update(account) AuditTrail.new(account, "UPDATED")
{{#tags}}- {{label}}
{{/tags}}