archivesspace / tech-docs

Technical documentation for ArchivesSpace
https://archivesspace.github.io/tech-docs/
Other
27 stars 28 forks source link

Doc not mentioning how to override core classes for backend #126

Open nebulon42 opened 2 years ago

nebulon42 commented 2 years ago

In plugins.md it says that you should add a after_initialize block to override core classes. However, this only works for Rails apps. Since the backend is a Sinatra app the doc misses a part on how to extend backend core classes. This would be helpful for people like me who are not too familiar with Ruby/Rack/Sinatra/Rails.

nebulon42 commented 2 years ago

After some tinkering I found out that I could use ArchivesSpaceService.loaded_hook do for it. But it also worked without that. I needed to better understand how this monkey-patching works in Ruby.