# -*- coding: utf-8 -*-

require 'filterrific/param_set'

require 'filterrific/has_reset_filterrific_url_mixin'

require 'filterrific/action_controller_extension'
require 'filterrific/action_view_extension'
require 'filterrific/active_record_extension'

module Filterrific
  class Engine < ::Rails::Engine

    # It's an engine so that we can add javascript and image assets
    # to the asset pipeline.

    isolate_namespace Filterrific

    ActiveSupport.on_load :action_controller do
      include Filterrific::ActionControllerExtension
    end

    ActiveSupport.on_load :action_view do
      include Filterrific::ActionViewExtension
    end

    ActiveSupport.on_load :active_record do
      extend Filterrific::ActiveRecordExtension
    end

    initializer "filterrific" do |app|
      app.config.assets.precompile += %w(filterrific-spinner.gif)
    end

  end
end

# -*- coding: utf-8 -*-

require 'filterrific/param_set'

require 'filterrific/has_reset_filterrific_url_mixin'

require 'filterrific/action_controller_extension'
require 'filterrific/action_view_extension'
require 'filterrific/active_record_extension'

module Filterrific
  class Engine < ::Rails::Engine

    # It's an engine so that we can add javascript and image assets
    # to the asset pipeline.

    isolate_namespace Filterrific

    ActiveSupport.on_load :action_controller do
      include Filterrific::ActionControllerExtension
    end

    ActiveSupport.on_load :action_view do
      include Filterrific::ActionViewExtension
    end

    ActiveSupport.on_load :active_record do
      extend Filterrific::ActiveRecordExtension
    end

    # sprockets-rails 3 tracks down the calls to `font_path` and `image_path`
    # and automatically precompiles the referenced assets.
    unless Rails::VERSION::MAJOR < 5
      initializer "filterrific.assets.precompile" do |app|
        app.config.assets.precompile += %w(filterrific/filterrific-spinner.gif)
      end
    end

  end
end

Add to assets.precompile only prior to Rails 5
Add to assets.precompile only prior to Rails 5