From 361722f2524fb420f79a354ab96c5bf0a71887d1 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Tue, 22 May 2012 11:17:50 +0800 Subject: [PATCH] fix orbit core to adopt current user behavior --- lib/orbit_core_lib.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/orbit_core_lib.rb b/lib/orbit_core_lib.rb index ad4f6756d..fcabad78c 100644 --- a/lib/orbit_core_lib.rb +++ b/lib/orbit_core_lib.rb @@ -32,7 +32,11 @@ module OrbitCoreLib end def get_object_auth_by_title(title) - self.object_auths.where({title: title }).first + oa = self.object_auths.where({title: title }).first + if oa.nil? && (self.class::ObjectAuthTitlesOptions.include? title) + oa = self.object_auths.build title: title + end + oa end def authed_users(title=nil)