Sha256: da148b6302bb3e4a45139a51197c2749358e447e82d1a91a949bb341469ab19f

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

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

module BlacklightAdvancedSearch
  class Engine < Rails::Engine
  
    # 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

1 entries across 1 versions & 1 rubygems

Version Path
blacklight_advanced_search-1.2.0 lib/blacklight_advanced_search/engine.rb