Browse files

Implemented after_destroy callback in ActionHandlerMembership to dele…

…te related completed sequences

git-svn-id: https://svn.xlsuite.org/internal/weputuplights.com/trunk@17192 bacab573-a924-0410-b505-ece3e248c36b
  • Loading branch information...
1 parent 9efc615 commit 189f2a92d24c33e1e63676b67fd2a332333ec3b3 harman committed Sep 15, 2009
Showing with 7 additions and 0 deletions.
  1. +7 −0 app/models/action_handler_membership.rb
View
7 app/models/action_handler_membership.rb
@@ -5,4 +5,11 @@ class ActionHandlerMembership < ActiveRecord::Base
validates_presence_of :action_handler_id, :party_id, :domain_id
validates_uniqueness_of :party_id, :scope => [:action_handler_id, :domain_id]
+
+ after_destroy :delete_completed_sequences
+
+ protected
+ def delete_completed_sequences
+ ActionHandlerPartyCompletedSequence.delete_all({:party_id => self.party.id, :domain_id => self.domain.id})
+ end
end

0 comments on commit 189f2a9

Please sign in to comment.