From a50ccdafb2b632ac9205ba3541fb8a4d5d856be5 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Tue, 16 Oct 2012 15:08:02 +0800 Subject: [PATCH] consolidate_object_auth for 171 production --- app/models/module_app.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/module_app.rb b/app/models/module_app.rb index ef249a0b..a177f23f 100644 --- a/app/models/module_app.rb +++ b/app/models/module_app.rb @@ -46,7 +46,7 @@ class ModuleApp def assign_manager(user,assigner) manager = AppManager.first(conditions: {managing_app_id: self.id,user_id: user.id}) rescue nil if manager.nil? - manager = self.managers.create(:user => user,:rule_creator => assigner) + manager = self.managers.create(:user_id => user.id,:rule_creator_id => (assigner.id rescue nil)) end manager end @@ -54,7 +54,7 @@ class ModuleApp def assign_sub_manager(user,assigner) submanager = AppManager.first(conditions: {sub_managing_app_id: self.id,user_id: user.id}) rescue nil if submanager.nil? && !self.managing_users.include?(user) - submanager = self.sub_managers.create(:user_id => user.id,:rule_creator_id => assigner.id) + submanager = self.sub_managers.create(:user_id => user.id,:rule_creator_id => (assigner.id rescue nil) ) end submanager end