Class: Sufia::Upgrade700Generator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/sufia/upgrade700_generator.rb

Instance Method Summary collapse

Instance Method Details



12
13
14
# File 'lib/generators/sufia/upgrade700_generator.rb', line 12

def banner
  say_status("info", "APPLYING SUFIA 7.0 CHANGES", :blue)
end

#qa_routesObject



22
23
24
25
26
# File 'lib/generators/sufia/upgrade700_generator.rb', line 22

def qa_routes
  insert_into_file "config/routes.rb", after: ".draw do" do
    "\n  mount Qa::Engine => '/authorities'\n"
  end
end

#qa_tablesObject



28
29
30
# File 'lib/generators/sufia/upgrade700_generator.rb', line 28

def qa_tables
  generate 'qa:local:tables'
end

#update_catalog_controllerObject

The engine routes have to come after the devise routes so that /users/sign_in will work



17
18
19
20
# File 'lib/generators/sufia/upgrade700_generator.rb', line 17

def update_catalog_controller
  # Nuke old search_params_logic
  gsub_file 'app/controllers/catalog_controller.rb', '[:add_access_controls_to_solr_params, :add_advanced_parse_q_to_solr]', 'search_params_logic + [:add_access_controls_to_solr_params]'
end