From e05cf2a2d697ee88399514f05ccb7bbe17669a18 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 ad4f6756..fcabad78 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)