diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/users_controller.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 584d08c..ea8ed69 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -22,6 +22,12 @@ class UsersController < ApplicationController def create @user = @parent.users.build(params[:user]) if @user.save + if VoicemailAccount.where(:name => "user_#{@user.user_name}").count == 0 + @user.voicemail_accounts.create(:name => "user_#{@user.user_name}", :active => true ) + else + @user.voicemail_accounts.create(:active => true) + end + if @parent.class == Tenant @parent.tenant_memberships.create(:user => @user) if @parent.user_groups.exists?(:name => 'Users') |