Skip to content

Commit

Permalink
Autoload constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Nov 5, 2015
1 parent a3a1932 commit 89f8a36
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
22 changes: 12 additions & 10 deletions app/models/blacklight/configuration.rb
Expand Up @@ -3,16 +3,18 @@ module Blacklight
# Blacklight::Configuration holds the configuration for a Blacklight::Controller, including
# fields to display, facets to show, sort options, and search fields.
class Configuration < OpenStructWithHashAccess

require_dependency 'blacklight/configuration/view_config'
require_dependency 'blacklight/configuration/tool_config'
# XXX this isn't very pretty, but it works.
require_dependency 'blacklight/configuration/fields'
require_dependency 'blacklight/configuration/field'
require_dependency 'blacklight/configuration/solr_field'
require_dependency 'blacklight/configuration/search_field'
require_dependency 'blacklight/configuration/facet_field'
require_dependency 'blacklight/configuration/sort_field'
extend ActiveSupport::Autoload

eager_autoload do
autoload :ViewConfig
autoload :ToolConfig
autoload :Fields
autoload :Field
autoload :SolrField
autoload :SearchField
autoload :FacetField
autoload :SortField
end
include Fields

# Set up Blacklight::Configuration.default_values to contain
Expand Down
17 changes: 8 additions & 9 deletions app/models/blacklight/solr/response.rb
@@ -1,14 +1,13 @@
class Blacklight::Solr::Response < HashWithIndifferentAccess
extend Deprecation

require_dependency 'blacklight/solr/response/pagination_methods'

require_dependency 'blacklight/solr/response/response'
require_dependency 'blacklight/solr/response/spelling'
require_dependency 'blacklight/solr/response/facets'
require_dependency 'blacklight/solr/response/more_like_this'
autoload :GroupResponse, 'blacklight/solr/response/group_response'
autoload :Group, 'blacklight/solr/response/group'
extend ActiveSupport::Autoload

autoload :PaginationMethods
autoload :Spelling
autoload :Facets
autoload :MoreLikeThis
autoload :GroupResponse
autoload :Group

include PaginationMethods
include Spelling
Expand Down

0 comments on commit 89f8a36

Please sign in to comment.