summaryrefslogtreecommitdiff
path: root/app/controllers/phones_controller.rb
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2012-12-23 16:04:05 +0100
committerspag <spag@golwen.net>2012-12-23 16:04:05 +0100
commit55a0d5ce38f99226174f358279c02178eacd75d7 (patch)
tree8ad5fe87d51760bf8fa76bd60337c25ff16726f5 /app/controllers/phones_controller.rb
parentf425280a6312638f364f6ae8d915a30d78a8dce4 (diff)
login/logout methods
Diffstat (limited to 'app/controllers/phones_controller.rb')
-rw-r--r--app/controllers/phones_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/phones_controller.rb b/app/controllers/phones_controller.rb
index d46bf86..0b765e8 100644
--- a/app/controllers/phones_controller.rb
+++ b/app/controllers/phones_controller.rb
@@ -14,7 +14,6 @@ class PhonesController < ApplicationController
def new
@phone = @phoneable.phones.build()
-
# Use the last phone.phone_model as the default.
#
@phone.phone_model_id = Phone.last.try(:phone_model).try(:id)
@@ -22,6 +21,10 @@ class PhonesController < ApplicationController
def create
@phone = @phoneable.phones.build(params[:phone])
+ if !@tenant
+ @tenant = @user.current_tenant
+ end
+ @phone.tenant = @tenant
if @phone.save
m = method( :"#{@phoneable.class.name.underscore}_phone_path" )
redirect_to m.( @phoneable, @phone ), :notice => t('phones.controller.successfuly_created')