Sha256: dee1a1a0836aaa86bf5d3ab7662dcfb02176d95d8a824cb858a753d17747260c

Contents?: true

Size: 807 Bytes

Versions: 1

Compression:

Stored size: 807 Bytes

Contents

require 'daimon/exhibition/model'
require 'daimon/exhibition/controller'

module Daimon
  module Exhibition
    class Engine < ::Rails::Engine
      isolate_namespace Daimon::Exhibition

      initializer 'daimon-exhibition.setup' do |app|
        ActiveSupport.on_load :active_record do
          ActiveRecord::Base.singleton_class.prepend Module.new {
            def inherited(base)
              super

              base.include Model unless base < Model
            end
          }
        end

        ActiveSupport.on_load :action_controller do
          ActionController::Base.singleton_class.prepend Module.new {
            def inherited(base)
              super

              base.include Controller unless base < Controller
            end
          }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
daimon-exhibition-0.1.0 lib/daimon/exhibition/engine.rb