Sha256: 459239fac9161f65df2732c1f9e10971514386b422e62ffcb96e5e2d9e185d05

Contents?: true

Size: 980 Bytes

Versions: 18

Compression:

Stored size: 980 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}/lib/generators/templates/effective_regions.rb")
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
effective_regions-1.6.14 lib/effective_regions/engine.rb
effective_regions-1.6.12 lib/effective_regions/engine.rb
effective_regions-1.6.11 lib/effective_regions/engine.rb
effective_regions-1.6.10 lib/effective_regions/engine.rb
effective_regions-1.6.9 lib/effective_regions/engine.rb
effective_regions-1.6.8 lib/effective_regions/engine.rb
effective_regions-1.6.7 lib/effective_regions/engine.rb
effective_regions-1.6.6 lib/effective_regions/engine.rb
effective_regions-1.6.5 lib/effective_regions/engine.rb
effective_regions-1.6.4 lib/effective_regions/engine.rb
effective_regions-1.6.3 lib/effective_regions/engine.rb
effective_regions-1.6.2 lib/effective_regions/engine.rb
effective_regions-1.6.1 lib/effective_regions/engine.rb
effective_regions-1.6.0 lib/effective_regions/engine.rb
effective_regions-1.5.0 lib/effective_regions/engine.rb
effective_regions-1.4.11 lib/effective_regions/engine.rb
effective_regions-1.4.10 lib/effective_regions/engine.rb
effective_regions-1.4.9 lib/effective_regions/engine.rb