| 
									
										
										
										
											2011-11-17 12:02:58 +00:00
										 |  |  | module Admin::UserHelper | 
					
						
							| 
									
										
										
										
											2011-11-12 09:54:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def show_user_attribute(object, key, locale = '') | 
					
						
							| 
									
										
										
										
											2011-11-16 01:47:09 +00:00
										 |  |  |     attribute = object.attribute_values.detect {|av| av.key.to_s.eql?(key.to_s) || av[locale.to_s].eql?(locale.to_s) } rescue nil | 
					
						
							|  |  |  |     if attribute | 
					
						
							|  |  |  |       if locale.to_s.blank? | 
					
						
							|  |  |  |         attribute['key'] | 
					
						
							|  |  |  |       else | 
					
						
							|  |  |  |         attribute[locale.to_s] | 
					
						
							|  |  |  |       end | 
					
						
							| 
									
										
										
										
											2011-11-12 09:54:45 +00:00
										 |  |  |     else | 
					
						
							| 
									
										
										
										
											2011-11-16 01:47:09 +00:00
										 |  |  |       '' | 
					
						
							| 
									
										
										
										
											2011-11-12 09:54:45 +00:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | end |