2011-07-26 19:20:03 +00:00
|
|
|
require 'bushido'
|
2011-07-26 02:37:23 +00:00
|
|
|
|
2011-07-26 19:20:03 +00:00
|
|
|
module Locomotive
|
|
|
|
module Hosting
|
|
|
|
module Bushido
|
|
|
|
module Enabler
|
|
|
|
|
|
|
|
module ClassMethods
|
|
|
|
|
|
|
|
def subscribe_to_events
|
|
|
|
::Bushido::Data.listen('app.claimed') do |event|
|
|
|
|
Locomotive.log "Saving #{Account.first.inspect} with incoming data #{event.inspect}"
|
|
|
|
|
|
|
|
account = Account.first
|
|
|
|
account.email = event['data'].try(:[], 'email')
|
|
|
|
account.name = account.email.split('@').first
|
|
|
|
account.save
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-07-26 02:37:23 +00:00
|
|
|
end
|