Class: EntityObserver

Inherits:
ActiveRecord::Observer
  • Object
show all
Defined in:
app/models/observers/entity_observer.rb

Overview

Copyright © 2008-2013 Michael Dvorkin and contributors.

Fat Free CRM is freely distributable under the terms of MIT license. See MIT-LICENSE file or www.opensource.org/licenses/mit-license.php


Instance Method Summary collapse

Instance Method Details

#after_create(item) ⇒ Object



11
12
13
# File 'app/models/observers/entity_observer.rb', line 11

def after_create(item)
  send_notification_to_assignee(item) if current_user != item.assignee
end

#after_update(item) ⇒ Object



15
16
17
18
19
# File 'app/models/observers/entity_observer.rb', line 15

def after_update(item)
  if item.saved_change_to_assigned_to? && item.assignee != current_user
    send_notification_to_assignee(item)
  end
end