Fix bug when object_auth was only built but not created
This commit is contained in:
		
							parent
							
								
									f497851fe3
								
							
						
					
					
						commit
						dd4c1697cd
					
				| 
						 | 
					@ -34,7 +34,7 @@ module  OrbitCoreLib
 | 
				
			||||||
    def get_object_auth_by_title(title)
 | 
					    def get_object_auth_by_title(title)
 | 
				
			||||||
      oa = self.object_auths.where({title: title }).first
 | 
					      oa = self.object_auths.where({title: title }).first
 | 
				
			||||||
       if oa.nil? && (self.class::ObjectAuthTitlesOptions.include? title)
 | 
					       if oa.nil? && (self.class::ObjectAuthTitlesOptions.include? title)
 | 
				
			||||||
        oa =  self.object_auths.build title: title
 | 
					        oa =  self.object_auths.create title: title
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
      oa
 | 
					      oa
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue