diff --git a/app/models/qbo.rb b/app/models/qbo.rb index 8688103..7efff7d 100644 --- a/app/models/qbo.rb +++ b/app/models/qbo.rb @@ -12,17 +12,6 @@ class Qbo < ActiveRecord::Base unloadable validates_presence_of :qb_token, :qb_secret, :company_id, :token_expires_at, :reconnect_token_at - QB_KEY = Setting.plugin_redmine_qbo['settingsOAuthConsumerKey'] - QB_SECRET = Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret'] - - # Quickbooks Config Info - $qb_oauth_consumer = OAuth::Consumer.new(QB_KEY, QB_SECRET, { - :site => "https://oauth.intuit.com", - :request_token_path => "/oauth/v1/get_request_token", - :authorize_url => "https://appcenter.intuit.com/Connect/Begin", - :access_token_path => "/oauth/v1/get_access_token" - }) - # Configure quickbooks-ruby-base to access our database Quickbooks::Base.configure do |c| c.persistent_token = 'qb_token' @@ -31,7 +20,13 @@ class Qbo < ActiveRecord::Base end def self.get_oauth_consumer - return $qb_oauth_consumer + # Quickbooks Config Info + return OAuth::Consumer.new(Setting.plugin_redmine_qbo['settingsOAuthConsumerKey'], Setting.plugin_redmine_qbo['settingsOAuthConsumerSecret'], { + :site => "https://oauth.intuit.com", + :request_token_path => "/oauth/v1/get_request_token", + :authorize_url => "https://appcenter.intuit.com/Connect/Begin", + :access_token_path => "/oauth/v1/get_access_token" + }) end # Get a quickbooks base object for type