diff --git a/init.rb b/init.rb index 4f2fa56..e14c248 100644 --- a/init.rb +++ b/init.rb @@ -18,10 +18,16 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. require 'redmine' -require 'dispatcher' +require 'dispatcher' unless Rails::VERSION::MAJOR >= 3 -Dispatcher.to_prepare do - require 'redmine_ical/patch_redmine_classes' +if Rails::VERSION::MAJOR >= 3 + ActionDispatch::Callbacks.to_prepare do + require 'redmine_ical/patch_redmine_classes' + end +else + Dispatcher.to_prepare do + require 'redmine_ical/patch_redmine_classes' + end end require_dependency 'redmine_ical/view_hooks' diff --git a/lib/redmine_ical/patch_redmine_classes.rb b/lib/redmine_ical/patch_redmine_classes.rb index 3402bc9..d561416 100644 --- a/lib/redmine_ical/patch_redmine_classes.rb +++ b/lib/redmine_ical/patch_redmine_classes.rb @@ -79,7 +79,7 @@ def self.included(receiver) unloadable include ApplicationHelper alias_method_chain :show, :ical - accept_api_auth :show + accept_rss_auth :show end end end