orbit-4-2/app/models/desktop/widget_layout.rb

19 lines
242 B
Ruby
Raw Permalink Normal View History

class WidgetLayout < DesignFile
attr_reader :content
field :body
belongs_to :desktop_widget
def content
self.file.read.force_encoding("UTF-8") rescue ''
end
def self.exist_one?
WidgetLayout.count > 0
end
end