forked from mavimo/redmine_cors
-
Notifications
You must be signed in to change notification settings - Fork 7
/
init.rb
30 lines (25 loc) · 775 Bytes
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'redmine'
if Rails::VERSION::MAJOR < 3
require 'dispatcher'
object_to_prepare = Dispatcher
else
object_to_prepare = Rails.configuration
# if redmine plugins were railties:
# object_to_prepare = config
end
object_to_prepare.to_prepare do
ApplicationController.send(:include, RedmineCors::Patches::ApplicationController)
end
Redmine::Plugin.register :redmine_cors do
name 'Redmine CORS'
author 'Marco Vito Moscaritolo'
description 'This is a plugin for Redmine that make possible CORS request.'
url 'http://github.com/mavimo/redmine_cors'
author_url 'http://mavimo.org/'
version '0.0.1'
requires_redmine :version_or_higher => '2.0.0'
settings :partial => 'settings/cors_settings',
:default => {
"cors_domain" => "",
}
end