User deletion

This commit is contained in:
Gopesh Tulsyan 2014-08-10 11:41:35 +05:30
parent a2b8806e35
commit 6890802a78
8 changed files with 60 additions and 9 deletions

View file

@ -5,4 +5,10 @@ class EventUser < ActiveRecord::Base
belongs_to :event
belongs_to :user
def self.create_deleted_eventuser(user,event)
event_role = event.event_users.where(user: user).first.event_role
event.event_users.where(user: user).destroy_all
EventUser.create(user: User.find_by(email: 'deleted@localhost.osem'), event: event, event_role: event_role)
end
end