This repository has been archived by the owner on May 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.rb
35 lines (29 loc) · 1.21 KB
/
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
31
32
33
34
35
require 'redmine'
require 'dispatcher'
require_dependency 'principal'
require_dependency 'user'
require_dependency 'profile_hook'
RAILS_DEFAULT_LOGGER.info 'Starting Extended Profile plugin for Redmine'
Dispatcher.to_prepare :extended_profile_plugin do
unless User.included_modules.include?(ExtendedUserPatch)
User.send(:include, ExtendedUserPatch)
end
unless MyController.included_modules.include?(MyExtendedControllerPatch)
MyController.send(:include, MyExtendedControllerPatch)
end
unless UsersController.included_modules.include?(ExtendedUsersControllerPatch)
UsersController.send(:include, ExtendedUsersControllerPatch)
end
unless AccountController.included_modules.include?(ExtendedAccountControllerPatch)
AccountController.send(:include, ExtendedAccountControllerPatch)
end
end
Redmine::Plugin.register :extended_profile_plugin do
name 'Extended profile'
author 'Andriy Lesyuk'
author_url 'http://www.andriylesyuk.com'
description 'Adds many new fields to user profile.'
url 'http://projects.andriylesyuk.com/projects/redmine-profile'
version '0.0.3'
settings :default => { :require_project => true }, :partial => 'settings/profile'
end