Sha256: bc27df5e204c14e22b9bd216ce62b12f505d5bebde0ddfbad650a36965255d9e

Contents?: true

Size: 642 Bytes

Versions: 1

Compression:

Stored size: 642 Bytes

Contents

module Simplec
  class Engine < ::Rails::Engine
    isolate_namespace Simplec

    initializer "simplec_controller_extensions" do
      ActiveSupport.on_load(:action_controller_base) {
        include Simplec::ActionController::Extensions
        prepend Simplec::PageActionHelpers
        helper Simplec::ActionView::Helper
        helper *Simplec.helpers
      }
      # Not required anymore, keep in Page Model in host application
      # ActiveSupport.on_load(:active_record) { Simplec.load_pages }
    end
  end

  def self.load_pages
    Dir["#{Rails.root}/app/models/page/*.rb"].
      each {|file| require_dependency file }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simplec-0.10.1 lib/simplec/engine.rb