11 lines
		
	
	
		
			269 B
		
	
	
	
		
			Ruby
		
	
	
	
		
		
			
		
	
	
			11 lines
		
	
	
		
			269 B
		
	
	
	
		
			Ruby
		
	
	
	
|  | class ObjectAuth  < PrototypeAuth | ||
|  | 
 | ||
|  |   belongs_to :obj_authable, polymorphic: true | ||
|  |   # > - Something.find_with_auth(query) | ||
|  |   # > - or Something.find(query).auth | ||
|  |   def auth_obj | ||
|  |     class_obj = eval(self.obj_authable_type) | ||
|  |     class_obj.find self.obj_authable_id | ||
|  |   end | ||
|  | 
 | ||
|  | end |