Permalink
Browse files

Wrapper for accept_api_auth in Redmine < 1.2

  • Loading branch information...
1 parent 6dff0aa commit 693830e6d6a971c195ee738f966d718af1a307d7 Sven Krzyzak committed Aug 3, 2011
@@ -0,0 +1,13 @@
+class MylynConnector::ApplicationController < ApplicationController
+ unloadable
+
+ def self.accept_api_auth(*actions)
+
+ begin
+ super *actions #Redmine>=1.2
+ rescue
+ accept_key_auth *actions #Redmine<1.2
+ end
+ end
+
+end
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::CustomFieldsController < ApplicationController
+class MylynConnector::CustomFieldsController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
@@ -1,11 +1,11 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::InformationController < ApplicationController
+class MylynConnector::InformationController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ include MylynConnector::Version::ClassMethods
- accept_key_auth :version, :token #Redmine<1.2
- accept_api_auth :version, :token, :authtest #Redmine>=1.2
+ accept_api_auth :version, :token, :authtest
skip_before_filter :verify_authenticity_token
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::IssueCategoriesController < ApplicationController
+class MylynConnector::IssueCategoriesController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
@@ -1,12 +1,11 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::IssuePrioritiesController < ApplicationController
+class MylynConnector::IssuePrioritiesController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
include MylynConnector::Version::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::IssueStatusController < ApplicationController
+class MylynConnector::IssueStatusController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::IssuesController < ApplicationController
+class MylynConnector::IssuesController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
- accept_key_auth :show, :index, :list, :updated_since #Redmine<1.2
- accept_api_auth :show, :index, :list, :updated_since #Redmine>=1.2
+ accept_api_auth :show, :index, :list, :updated_since
skip_before_filter :verify_authenticity_token
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::ProjectsController < ApplicationController
+class MylynConnector::ProjectsController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::QueriesController < ApplicationController
+class MylynConnector::QueriesController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::SettingsController < ApplicationController
+class MylynConnector::SettingsController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
@@ -1,12 +1,11 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::TimeEntryActivitiesController < ApplicationController
+class MylynConnector::TimeEntryActivitiesController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
include MylynConnector::Version::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::TrackersController < ApplicationController
+class MylynConnector::TrackersController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
@@ -1,12 +1,11 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::UsersController < ApplicationController
+class MylynConnector::UsersController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
include MylynConnector::Version::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../../../lib/mylyn_connector'
-class MylynConnector::VersionsController < ApplicationController
+class MylynConnector::VersionsController < MylynConnector::ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
- accept_key_auth :all #Redmine<1.2
- accept_api_auth :all #Redmine>=1.2
+ accept_api_auth :all
skip_before_filter :verify_authenticity_token
View
@@ -1,3 +1,6 @@
+Version 2.7.4
+ chg : Wrapper for accept_api_auth in Redmine < 1.2
+
Version 2.7.3
chg : Fixtures adapted for Redmine 1.2
add : Support for accept_api_auth (new in Redmine 1.2)

0 comments on commit 693830e

Please sign in to comment.