archivesspace-plugins / lcnaf

6 stars 3 forks source link

LCNAF routes changes should be able to handle older versions #2

Closed lmcglohon closed 7 years ago

lmcglohon commented 7 years ago

Using code from HM (https://github.com/hudmol/nla_accession_reports/blob/master/frontend/plugin_init.rb), here is the fix:

in the plugin_init.rb file, replace:

ArchivesSpace::Application.extend_aspace_routes(File.join(File.dirname(FILE), "routes.rb"))

with:

`if ArchivesSpace::Application.respond_to?(:extend_aspace_routes)

> v2.0 way of defining routes

ArchivesSpace::Application.extend_aspace_routes(File.join(File.dirname(FILE), "routes.rb")) else

< v2.0 way of defining routes

my_routes = [File.join(File.dirname(FILE), "routes.rb")] ArchivesSpace::Application.config.paths['config/routes'].concat(my_routes) end`

lmcglohon commented 7 years ago

see note in PR #3