Skip to content

Commit

Permalink
Drop support for rails 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Oct 4, 2018
1 parent a43a0b1 commit d85af9a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ rails generate blacklight:install

## Dependencies

* Ruby 2.1+
* Ruby 2.2+
* Bundler
* Rails 5.0+
* Rails 5.1+

## Configuring Apache Solr
You'll also want some information about how Blacklight expects [Apache Solr](http://lucene.apache.org/solr ) to run, which you can find in [README_SOLR](https://github.com/projectblacklight/blacklight/wiki/README_SOLR)
Expand Down
12 changes: 2 additions & 10 deletions app/controllers/concerns/blacklight/bookmarks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,7 @@ def create
flash[:error] = I18n.t('blacklight.bookmarks.add.failure', count: @bookmarks.length)
end

if respond_to? :redirect_back
redirect_back fallback_location: bookmarks_path
else
# Deprecated in Rails 5.0
redirect_to :back
end
redirect_back fallback_location: bookmarks_path
end
end

Expand All @@ -117,11 +112,8 @@ def destroy
if success
if request.xhr?
render(json: { bookmarks: { count: current_or_guest_user.bookmarks.count } })
elsif respond_to? :redirect_back
redirect_back fallback_location: bookmarks_path, notice: I18n.t('blacklight.bookmarks.remove.success')
else
# Deprecated in Rails 5.0
redirect_to :back, notice: I18n.t('blacklight.bookmarks.remove.success')
redirect_back fallback_location: bookmarks_path, notice: I18n.t('blacklight.bookmarks.remove.success')
end
elsif request.xhr?
head 500 # ajaxy request needs no redirect and should not have flash set
Expand Down
7 changes: 1 addition & 6 deletions app/controllers/concerns/blacklight/search_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ def clear
flash[:error] = I18n.t('blacklight.search_history.clear.failure')
end

if respond_to? :redirect_back
redirect_back fallback_location: blacklight.search_history_path
else
# Deprecated in Rails 5.0
redirect_to :back
end
redirect_back fallback_location: blacklight.search_history_path
end
end
end
2 changes: 1 addition & 1 deletion blacklight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |s|

s.required_ruby_version = '~> 2.1'

s.add_dependency "rails", "~> 5.0"
s.add_dependency "rails", "~> 5.1"
s.add_dependency "globalid"
s.add_dependency "jbuilder", '~> 2.7'
s.add_dependency "nokogiri", "~>1.6" # XML Parser
Expand Down
6 changes: 1 addition & 5 deletions lib/generators/blacklight/assets_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,11 @@ def assets

# This is not a default in Rails 5.1+
def add_jquery
gem 'jquery-rails' if needs_jquery?
gem 'jquery-rails'
end

private

def needs_jquery?
Rails.version >= '5.1'
end

def turbolinks?
@turbolinks ||= IO.read("app/assets/javascripts/application.js").include?('turbolinks')
end
Expand Down

0 comments on commit d85af9a

Please sign in to comment.