summaryrefslogtreecommitdiff
path: root/app/controllers/tenants_controller.rb
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2012-12-31 08:50:27 +0100
committerspag <spag@golwen.net>2012-12-31 08:50:27 +0100
commitaed84444142604a62e37e57acfaaf957219e2c8d (patch)
treee00b1f5844590393171e0bc839ab516d39f5144d /app/controllers/tenants_controller.rb
parentc24bd3a8212e85894b2f7c26e190fe5e89fbaaf2 (diff)
parent12c8f4c82770ded6ea6b519e4451ed6757419ddf (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app/controllers/tenants_controller.rb')
-rw-r--r--app/controllers/tenants_controller.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/app/controllers/tenants_controller.rb b/app/controllers/tenants_controller.rb
index 724d179..7bb8ecd 100644
--- a/app/controllers/tenants_controller.rb
+++ b/app/controllers/tenants_controller.rb
@@ -58,14 +58,27 @@ class TenantsController < ApplicationController
end
if Delayed::Job.count > 0
- redirect_to @tenant, :notice => t('tenants.controller.successfuly_created_plus_delayed_jobs',
+ if SipAccount.any? || Phone.any?
+ redirect_to @tenant, :notice => t('tenants.controller.successfuly_created_plus_delayed_jobs',
:resource => @tenant,
:amount_of_numbers => @tenant.array_of_internal_extension_numbers.count + @tenant.array_of_dids.count
)
- else
- redirect_to @tenant, :notice => t('tenants.controller.successfuly_created',
- :resource => @tenant
+ else
+ redirect_to page_beginners_intro_path, :notice => t('tenants.controller.successfuly_created_plus_delayed_jobs',
+ :resource => @tenant,
+ :amount_of_numbers => @tenant.array_of_internal_extension_numbers.count + @tenant.array_of_dids.count
)
+ end
+ else
+ if SipAccount.any? || Phone.any?
+ redirect_to @tenant, :notice => t('tenants.controller.successfuly_created',
+ :resource => @tenant
+ )
+ else
+ redirect_to page_beginners_intro_path, :notice => t('tenants.controller.successfuly_created',
+ :resource => @tenant
+ )
+ end
end
else
render :new