| 
									
										
										
										
											2012-11-01 12:42:40 +00:00
										 |  |  | class WidgetLayout < DesignFile | 
					
						
							|  |  |  |   | 
					
						
							|  |  |  |   attr_reader :content | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   field :body | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   belongs_to :desktop_widget | 
					
						
							| 
									
										
										
										
											2012-11-05 15:04:54 +00:00
										 |  |  |    | 
					
						
							| 
									
										
										
										
											2012-11-01 12:42:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def content | 
					
						
							|  |  |  |     self.file.read.force_encoding("UTF-8") rescue '' | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def self.exist_one? | 
					
						
							|  |  |  |     WidgetLayout.count > 0
 | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  | end |