class UzuUzu::Info
Public Class Methods
fixture_load()
click to toggle source
# File lib/uzuuzu-cms/model/info.rb, line 65 def self.fixture_load # fixture load ::UzuUzu.logger.debug 'fixture load start' Dir.glob('./fixture/**/*.*').each do |path| ::UzuUzu.logger.debug "fixture file : #{path}" paths = path.split('/') model_name = ::File.basename(paths.pop, '.*') while !paths.blank? && paths[-1] != 'fixture' model_name = "#{paths.pop.camel_case}::#{model_name.camel_case}" end begin ::UzuUzu.logger.debug "fixture model name : #{model_name}" model = eval("::#{model_name}") ::UzuUzu::DataStore::Fixture.import_file(model, path, true) rescue NameError => e ::UzuUzu.logger.error(e.to_s) end end ::UzuUzu.logger.debug 'fixture load end' end
initialize?()
click to toggle source
# File lib/uzuuzu-cms/model/info.rb, line 90 def self.initialize? info = self.uniq info.initialize? end
uniq()
click to toggle source
# File lib/uzuuzu-cms/model/info.rb, line 46 def self.uniq ret = nil UzuUzu.transaction do |tr| tr.begin ary = self.all if ary.empty? fixture_load end ary = self.all ret = ary.pop ary.each do |record| record.destroy end tr.commit end ret end
Public Instance Methods
contents_render(options={}, locals={})
click to toggle source
# File lib/uzuuzu-cms/model/info.rb, line 115 def contents_render(options={}, locals={}) '' end
css_urls()
click to toggle source
# File lib/uzuuzu-cms/model/info.rb, line 103 def css_urls self.csses.map do |css| css.url end end
initialize?()
click to toggle source
# File lib/uzuuzu-cms/model/info.rb, line 86 def initialize? self.step >= 2 end
js_urls()
click to toggle source
# File lib/uzuuzu-cms/model/info.rb, line 109 def js_urls self.javascripts.map do |js| js.url end end
layout_fix()
click to toggle source
# File lib/uzuuzu-cms/model/info.rb, line 99 def layout_fix self.layout end
page_title()
click to toggle source
# File lib/uzuuzu-cms/model/info.rb, line 119 def page_title self.title end
render(options={}, locals={})
click to toggle source
# File lib/uzuuzu-cms/model/info.rb, line 123 def render(options={}, locals={}) self.layout.render(options, locals) end