Sha256: a193863c7b0ebd14ffa000551e2c0abf708104cb7c549e5957c376569f0bd348

Contents?: true

Size: 962 Bytes

Versions: 5

Compression:

Stored size: 962 Bytes

Contents

module EffectiveRegions
  class Engine < ::Rails::Engine
    engine_name 'effective_regions'

    config.autoload_paths += Dir["#{config.root}/app/models/concerns"]

    # Include Helpers to base application
    initializer 'effective_regions.action_controller' do |app|
      ActiveSupport.on_load :action_controller do
        helper EffectiveRegionsHelper
        ActionController::Base.send :include, ::EffectiveRegionsControllerHelper
      end
    end

    # Include acts_as_addressable concern and allow any ActiveRecord object to call it
    initializer 'effective_regions.active_record' do |app|
      ActiveSupport.on_load :active_record do
        ActiveRecord::Base.extend(ActsAsRegionable::ActiveRecord)
      end
    end

    # Set up our default configuration options.
    initializer "effective_regions.defaults", :before => :load_config_initializers do |app|
      eval File.read("#{config.root}/config/effective_regions.rb")
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
effective_regions-1.7.4 lib/effective_regions/engine.rb
effective_regions-1.7.3 lib/effective_regions/engine.rb
effective_regions-1.7.2 lib/effective_regions/engine.rb
effective_regions-1.7.1 lib/effective_regions/engine.rb
effective_regions-1.7.0 lib/effective_regions/engine.rb