Sha256: ce886f15df64ae63b521446369ff6be6072b37e5f0d84a5c34a4f2d5805515db

Contents?: true

Size: 1.28 KB

Versions: 4

Compression:

Stored size: 1.28 KB

Contents

require 'cql_ruby'

require 'rails'
require 'blacklight'
require 'blacklight_cql'

require 'blacklight_cql/solr_helper_extension'
require 'blacklight_cql/template_helper_extension'


module BlacklightCql
  class Engine < Rails::Engine
  
    
    # Call in after_initialze to make sure the default search_fields are
    # already created, AND the local app has had the opportunity to customize
    # our placeholder search_field.
    config.after_initialize do
      Blacklight.config[:search_fields] << BlacklightCql::SolrHelperExtension.pseudo_search_field
    end

    
    # Wrapping in Dispatcher.to_prepare will, theoretically, take care of things
    # working properly even in development mode with cache_classes=false (per-request
    # class reloading).
    config.to_prepare do
       #Check in  case CatalogController _hasn't_ really been re-loaded
       unless (CatalogController.kind_of?( BlacklightCql::SolrHelperExtension ))
         # Will over-ride #solr_params to deal with CQL
         CatalogController.send(:include, BlacklightCql::SolrHelperExtension)
         
         # Will over-ride helper methods for search form select,  to ensure
         # query is echo'd properly.
         CatalogController.send(:helper, BlacklightCql::TemplateHelperExtension)
       end
    end

    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blacklight_cql-1.0.0 lib/blacklight_cql/engine.rb
blacklight_cql-1.0.0pre3 lib/blacklight_cql/engine.rb
blacklight_cql-1.0.0pre2 lib/blacklight_cql/engine.rb
blacklight_cql-1.0.0pre1 lib/blacklight_cql/engine.rb