From d1306aec53c7301c54ae9169c53057602d4c59fe Mon Sep 17 00:00:00 2001 From: Sean Grove Date: Wed, 16 Nov 2011 11:39:47 -0800 Subject: [PATCH] Horrific rebasing strategy, but working code. --- lib/locomotive/hosting/bushido/hooks.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/locomotive/hosting/bushido/hooks.rb b/lib/locomotive/hosting/bushido/hooks.rb index d0d552a8..5e0abd5b 100644 --- a/lib/locomotive/hosting/bushido/hooks.rb +++ b/lib/locomotive/hosting/bushido/hooks.rb @@ -41,8 +41,11 @@ module Locomotive Locomotive.log "Devise username column: #{::Devise.cas_username_column}=" Locomotive.log "Removing username: #{event['data'].try(:[], 'ido_id')}" - Account.exists?(::Devise.cas_username_column => event['data'].try(:[], 'ido_id')) and - Account.where(::Devise.cas_username_column => event['data'].try(:[], 'ido_id')).destroy + ido_id = event['data'].try(:[], 'ido_id') + + ido_id and + Account.exists?(::Devise.cas_username_column => ido_id) and + Account.where(::Devise.cas_username_column => ido_id).destroy end end