Sha256: 35debdbad1be805d259beca7f656dcf33b5e779a1294e3824d014f206a71acc5

Contents?: true

Size: 987 Bytes

Versions: 1

Compression:

Stored size: 987 Bytes

Contents

module EffectiveAddresses
  class Engine < ::Rails::Engine
    engine_name 'effective_addresses'

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

    # Include Helpers to base application
    initializer 'effective_addresses.action_controller' do |app|
      ActiveSupport.on_load :action_controller do
        helper EffectiveAddressesHelper
      end
    end

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

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

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
effective_addresses-0.1 lib/effective_addresses/engine.rb