Skip to content

Commit

Permalink
Remove more deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Nov 9, 2015
1 parent 2efbcc0 commit 19eef78
Show file tree
Hide file tree
Showing 16 changed files with 3 additions and 99 deletions.
4 changes: 0 additions & 4 deletions app/controllers/concerns/blacklight/search_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ def fetch(id=nil, extra_controller_params={})
if id.is_a? Array
fetch_many(id, params, extra_controller_params)
else
if id.nil?
Deprecation.warn Blacklight::SearchHelper, "Calling #fetch without an explicit id argument is deprecated and will be removed in Blacklight 6.0"
id ||= params[:id]
end
fetch_one(id, extra_controller_params)
end
end
Expand Down
7 changes: 1 addition & 6 deletions app/helpers/blacklight/render_partials_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ def render_document_partials(doc, partials = [], locals ={})
# @param [String] base name for the partial
# @param [Hash] locales to pass through to the partials
def render_document_partial(doc, base_name, locals = {})
format = if method(:document_partial_name).arity == 1
Deprecation.warn self, "The #document_partial_name with a single argument is deprecated. Update your override to include a second argument for the 'base name'"
document_partial_name(doc)
else
document_partial_name(doc, base_name)
end
format = document_partial_name(doc, base_name)

view_type = document_index_view_type
template = cached_view ['show', view_type, base_name, format].join('_') do
Expand Down
5 changes: 0 additions & 5 deletions app/helpers/blacklight/url_helper_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@ def url_for_document(doc, options = {})
end

# link_to_document(doc, 'VIEW', :counter => 3)
# link_to_document(doc, :label=>'VIEW', :counter => 3)
# Use the catalog_path RESTful route to create a link to the show page for a specific item.
# catalog_path accepts a HashWithIndifferentAccess object. The solr query params are stored in the session,
# so we only need the +counter+ param here. We also need to know if we are viewing to document as part of search results.
def link_to_document(doc, field_or_opts = nil, opts={:counter => nil})
if field_or_opts.is_a? Hash
opts = field_or_opts
if opts[:label]
Deprecation.warn self, "The second argument to link_to_document should now be the label."
field = opts.delete(:label)
end
else
field = field_or_opts
end
Expand Down
6 changes: 0 additions & 6 deletions app/models/concerns/blacklight/solr/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
#

module Blacklight::Solr::Document
autoload :SchemaOrg, 'blacklight/solr/document/schema_org'
autoload :DublinCore, 'blacklight/solr/document/dublin_core'
autoload :Email, 'blacklight/solr/document/email'
autoload :Sms, 'blacklight/solr/document/sms'
autoload :Extensions, 'blacklight/solr/document/extensions'
autoload :Export, 'blacklight/solr/document/export'
autoload :MoreLikeThis, 'blacklight/solr/document/more_like_this'

extend ActiveSupport::Concern
Expand Down
7 changes: 0 additions & 7 deletions app/models/concerns/blacklight/solr/document/dublin_core.rb

This file was deleted.

7 changes: 0 additions & 7 deletions app/models/concerns/blacklight/solr/document/email.rb

This file was deleted.

7 changes: 0 additions & 7 deletions app/models/concerns/blacklight/solr/document/export.rb

This file was deleted.

8 changes: 0 additions & 8 deletions app/models/concerns/blacklight/solr/document/extensions.rb

This file was deleted.

7 changes: 0 additions & 7 deletions app/models/concerns/blacklight/solr/document/schema_org.rb

This file was deleted.

7 changes: 0 additions & 7 deletions app/models/concerns/blacklight/solr/document/sms.rb

This file was deleted.

18 changes: 2 additions & 16 deletions app/presenters/blacklight/document_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,29 +99,15 @@ def render_values(values, field_config = nil)
options = {}
options = field_config.separator_options if field_config && field_config.separator_options

if field_config && field_config.separator
Deprecation.warn(self.class, 'The field configuration #separator is deprecated. Use #separator_options instead')
options[:words_connector] ||= field_config.separator
options[:two_words_connector] ||= field_config.separator
options[:last_word_connector] ||= field_config.separator
end

values.map { |x| html_escape(x) }.to_sentence(options).html_safe
end

##
# Render the document index heading
#
# @param [Hash] opts (Deprecated)
# @option opts [Symbol] :label Render the given field from the document
# @option opts [Proc] :label Evaluate the given proc
# @option opts [String] :label Render the given string
# @param [Symbol, Proc, String] field Render the given field or evaluate the proc or render the given string
def render_document_index_label field, opts ={}
if field.is_a? Hash
Deprecation.warn DocumentPresenter, "Calling render_document_index_label with a hash is deprecated"
field = field[:label]
end
# @param [Hash] opts
def render_document_index_label(field, opts = {})
label = case field
when Symbol
@document[field]
Expand Down
2 changes: 0 additions & 2 deletions app/views/catalog/email_sent.html.erb

This file was deleted.

2 changes: 0 additions & 2 deletions app/views/catalog/sms_sent.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion lib/blacklight/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class Configuration < OpenStructWithHashAccess
# 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'
Expand Down
7 changes: 0 additions & 7 deletions lib/blacklight/configuration/solr_field.rb

This file was deleted.

7 changes: 0 additions & 7 deletions lib/railties/blacklight.rake
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ namespace :blacklight do
end
end

namespace :solr do
task :seed do
Deprecation.warn Blacklight, "blacklight:solr:seed is deprecated; use blacklight:index:seed instead"
Rake::Task['blacklight:index:seed'].invoke
end
end

namespace :check do
desc "Check the Solr connection and controller configuration"
task :solr, [:controller_name] => [:environment] do |_, args|
Expand Down

0 comments on commit 19eef78

Please sign in to comment.