Sha256: 5ce3dfaf755800bc0ced498d35bf7f5cc0bf6505acca1513b21fe5a48167e1c4

Contents?: true

Size: 1001 Bytes

Versions: 1

Compression:

Stored size: 1001 Bytes

Contents

module Netzke
  module Railz
    class Engine < Rails::Engine
      config.netzke = Netzke::Core::OptionsHash.new

      # before loading initializers and classes (in app/**)
      config.before_initialize do
        Netzke::Core.config = config.netzke
        Netzke::Core.ext_location = Rails.root.join("public", "extjs")
        Netzke::Core.touch_location = Rails.root.join("public", "sencha-touch")
        Netzke::Core.persistence_manager_class = Netzke::Core.persistence_manager.constantize rescue nil
      end

      # after loading initializers and classes
      config.after_initialize do
        Netzke::Core.with_icons = File.exists?("#{::Rails.root}/public#{Netzke::Core.icons_uri}") if Netzke::Core.with_icons.nil?

        # If need to cache classes, memoize Netzke::Base.constantize_class_name for performance
        if Rails.configuration.cache_classes
          class << Netzke::Base
            memoize :constantize_class_name
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
netzke-core-0.6.6 lib/netzke/railz/engine.rb