|
21 | 21 | Redmine::Plugin.register :redmine_local_avatars do
|
22 | 22 | name 'Redmine Local Avatars plugin'
|
23 | 23 | author 'Andrew Chaika and Luca Pireddu'
|
| 24 | + author_url 'https://github.com/ncoders/redmine_local_avatars' |
24 | 25 | description 'This plugin lets users upload avatars directly into Redmine'
|
25 |
| - version '1.0.5' |
| 26 | + version '1.0.6' |
26 | 27 | end
|
27 | 28 |
|
28 | 29 | receiver = Object.const_defined?('ActiveSupport::Reloader') ? ActiveSupport::Reloader : ActionDispatch::Callbacks
|
29 | 30 | receiver.to_prepare do
|
30 |
| - require_dependency 'project' |
31 |
| - require_dependency 'principal' |
32 |
| - require_dependency 'user' |
33 |
| - |
34 |
| - AccountController.send(:include, LocalAvatarsPlugin::AccountControllerPatch) |
35 |
| - ApplicationHelper.send(:include, LocalAvatarsPlugin::ApplicationAvatarPatch) |
36 |
| - MyController.send(:include, LocalAvatarsPlugin::MyControllerPatch) |
37 |
| - User.send(:include, LocalAvatarsPlugin::UsersAvatarPatch) |
38 |
| - UsersController.send(:include, LocalAvatarsPlugin::UsersControllerPatch) |
39 |
| - UsersHelper.send(:include, LocalAvatarsPlugin::UsersHelperPatch) |
| 31 | + require_dependency 'project' |
| 32 | + require_dependency 'principal' |
| 33 | + require_dependency 'user' |
| 34 | + |
| 35 | + helper_klass = ApplicationHelper.method_defined?(:avatar) ? ApplicationHelper : AvatarsHelper |
| 36 | + |
| 37 | + AccountController.send(:include, LocalAvatarsPlugin::AccountControllerPatch) |
| 38 | + helper_klass.send(:include, LocalAvatarsPlugin::ApplicationAvatarPatch) |
| 39 | + MyController.send(:include, LocalAvatarsPlugin::MyControllerPatch) |
| 40 | + User.send(:include, LocalAvatarsPlugin::UsersAvatarPatch) |
| 41 | + UsersController.send(:include, LocalAvatarsPlugin::UsersControllerPatch) |
| 42 | + UsersHelper.send(:include, LocalAvatarsPlugin::UsersHelperPatch) |
40 | 43 | end
|
41 | 44 |
|
42 | 45 | require 'local_avatars'
|
|
0 commit comments