Sha256: 1c3ecc17de925702769643b9060113475290bb62f2bac7bc09868d38f0463c3d

Contents?: true

Size: 1.46 KB

Versions: 9

Compression:

Stored size: 1.46 KB

Contents

require 'blacklight'
require 'blacklight_advanced_search'
require 'rails'

module BlacklightAdvancedSearch
  class Engine < Rails::Engine
  
    config.after_initialize do
      # After local app initializers that may set some config, we
      # finish it off with defaults and normalization. 
      BlacklightAdvancedSearch.init
    end

    
    # Do these things in a to_prepare block, to try and make them work
    # in development mode with class-reloading. The trick is we can't
    # be sure if the controllers we're modifying are being reloaded in
    # dev mode, if they are in the BL plugin and haven't been copied to
    # local, they won't be. But we do our best.
    config.to_prepare do    
      # Ordinary module over-ride to CatalogController
      CatalogController.send(:include,  
          BlacklightAdvancedSearch::Controller  
      ) unless
      CatalogController.include?(   
          BlacklightAdvancedSearch::Controller 
        )
      
      
      
      SearchHistoryController.send(:helper,
        BlacklightAdvancedSearch::RenderConstraintsOverride 
      ) unless
        SearchHistoryController.helpers.is_a?( 
          BlacklightAdvancedSearch::RenderConstraintsOverride 
        )
        
      SavedSearchesController.send(:helper,
        BlacklightAdvancedSearch::RenderConstraintsOverride 
      ) unless
        SearchHistoryController.helpers.is_a?( 
          BlacklightAdvancedSearch::RenderConstraintsOverride 
        )
        
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
blacklight_advanced_search-1.1.2 lib/blacklight_advanced_search/engine.rb
blacklight_advanced_search-1.1.1 lib/blacklight_advanced_search/engine.rb
blacklight_advanced_search-1.1.0 lib/blacklight_advanced_search/engine.rb
blacklight_advanced_search-1.0.0 lib/blacklight_advanced_search/engine.rb
blacklight_advanced_search-1.0.0pre5 lib/blacklight_advanced_search/engine.rb
blacklight_advanced_search-1.0.0pre4 lib/blacklight_advanced_search/engine.rb
blacklight_advanced_search-1.0.0pre3 lib/blacklight_advanced_search/engine.rb
blacklight_advanced_search-1.0.0pre2 lib/blacklight_advanced_search/engine.rb
blacklight_advanced_search-1.0.0pre1 lib/blacklight_advanced_search/engine.rb