Module: OpenProject::Plugins::PatchRegistry

Defined in:
lib/open_project/plugins/patch_registry.rb

Class Method Summary collapse

Class Method Details

.register(target, patch) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/open_project/plugins/patch_registry.rb', line 17

def self.register(target, patch)
  #patches[target] << patch

  ActiveSupport.on_load(target) do
    require_dependency patch
    constant = patch.camelcase.constantize

    target.to_s.camelcase.constantize.send(:include, constant)
  end
end