Method: Cms.init

Defined in:
lib/cms/init.rb

.initObject

This is called after the environment is ready



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/cms/init.rb', line 22

def init
  ActionController::Routing::RouteSet::Mapper.send :include, Cms::Routes
  ActiveSupport::Dependencies.load_paths += %W( #{RAILS_ROOT}/app/portlets )
  ActiveSupport::Dependencies.load_paths += %W( #{RAILS_ROOT}/app/portlets/helpers )      
  ActionController::Base.append_view_path DynamicView.base_path
  ActionView::Base.default_form_builder = Cms::FormBuilder
  
  # ActiveRecord JDBC adapter depends on no database connection having
  # been established to work properly.
  require 'jdbc_adapter' if defined?(JRUBY_VERSION)
  
  # This is just to be safe
  # dynamic views are stored in a tmp dir
  # so they could be blown away on a server restart or something
  # so this just makes sure they get written out
  DynamicView.write_all_to_disk! if DynamicView.table_exists?
end