Sha256: b80cfcbfb5bd5225725867dd8354edb8efceb4e61a80d5aaa8ce5b63d78ac4e9

Contents?: true

Size: 762 Bytes

Versions: 1

Compression:

Stored size: 762 Bytes

Contents

require 'rails/railtie'
require 'impartial/base'

module Impartial
  module Rails
    class Railtie < ::Rails::Railtie

      initializer 'impartial.autoload', :before => :set_autoload_paths do |app|
        app.config.autoload_paths << ::Rails.root.join('app', 'impartials')
      end

      initializer 'impartial.paths' do |app|
        Impartial.configure do |config|
          config.paths = [::Rails.root.join('app', 'impartials')]
        end
      end

      initializer "impartial.add_helper" do |app|
        ::Impartial::Base.class_eval do
          include app.routes.url_helpers
          include ::ApplicationHelper
          include ::ActionView::Helpers
          include ::Sprockets::Helpers::RailsHelper
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
impartial-rails-0.0.1 lib/impartial-rails/railtie.rb