Skip to content

Commit

Permalink
allow range limit and advanced search to install without conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tampakis committed Dec 21, 2017
1 parent 0e818da commit 7da6a87
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Layout/AlignParameters:
# Cop supports --auto-correct.
Layout/EmptyLineAfterMagicComment:
Exclude:
- 'lib/generators/blacklight_advanced_search/templates/saved_searches_controller.rb'
- 'lib/generators/blacklight_advanced_search/templates/search_history_controller.rb'

# Offense count: 1
Expand Down
15 changes: 11 additions & 4 deletions lib/generators/blacklight_advanced_search/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,19 @@ def configuration
end
end

# Adds advanced search behavior to search history controller
def install_search_history_controller
copy_file "search_history_controller.rb", "app/controllers/search_history_controller.rb"
end
path = 'app/controllers/search_history_controller.rb'

def install_saved_searches_controller
copy_file "saved_searches_controller.rb", "app/controllers/saved_searches_controller.rb"
# If local copy of search history controller exists, add override
if File.exist? path
inject_into_file path, after: /include Blacklight::SearchHistory.*$/ do
"\n helper BlacklightAdvancedSearch::RenderConstraintsOverride"
end
# Otherwise copies search history controller to application
else
copy_file 'search_history_controller.rb', path
end
end

def inject_routes
Expand Down

This file was deleted.

0 comments on commit 7da6a87

Please sign in to comment.