| 
									
										
										
										
											2012-02-07 08:16:48 +00:00
										 |  |  | class ObjectAuth  < PrototypeAuth | 
					
						
							| 
									
										
										
										
											2012-02-16 05:57:28 +00:00
										 |  |  |   include OrbitCoreLib::ObjectTokenUnility | 
					
						
							| 
									
										
										
										
											2012-02-17 09:50:23 +00:00
										 |  |  |   validates_uniqueness_of :obj_authable_type,:scope => :title #{ |c| } | 
					
						
							| 
									
										
										
										
											2012-02-07 08:16:48 +00:00
										 |  |  |   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 |