This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/models/design/layout.rb

25 lines
368 B
Ruby

class Layout < DesignFile
include ParserLayout
attr_reader :content
embeds_one :menu
embedded_in :design
embeds_many :layout_parts
before_save :parse_layout
def content
self.file.read.force_encoding("UTF-8") rescue ''
end
def self.exist_one?
Layout.count > 0
end
def parse_layout
parse_layout_contents(self)
end
end