Fixed autoload issues.
This commit is contained in:
parent
7a91637de4
commit
998a7f55d4
7 changed files with 50 additions and 94 deletions
|
@ -16,7 +16,7 @@ module Zammad
|
||||||
# -- all .rb files in that directory are automatically loaded.
|
# -- all .rb files in that directory are automatically loaded.
|
||||||
|
|
||||||
# Custom directories with classes and modules you want to be autoloadable.
|
# Custom directories with classes and modules you want to be autoloadable.
|
||||||
# config.autoload_paths += %W(#{config.root}/extras)
|
config.autoload_paths += Dir["#{config.root}/lib/**/"]
|
||||||
|
|
||||||
# Only load the plugins named here, in the order given (default is alphabetical).
|
# Only load the plugins named here, in the order given (default is alphabetical).
|
||||||
# :all can be used as a placeholder for all plugins not explicitly named.
|
# :all can be used as a placeholder for all plugins not explicitly named.
|
||||||
|
@ -25,12 +25,13 @@ module Zammad
|
||||||
# Activate observers that should always be running.
|
# Activate observers that should always be running.
|
||||||
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
||||||
config.active_record.observers =
|
config.active_record.observers =
|
||||||
:history_observer,
|
'observer::_history',
|
||||||
'ticket::_observer::_first_response',
|
'observer::_ticket::_first_response',
|
||||||
'ticket::_observer::_last_contact',
|
'observer::_ticket::_last_contact',
|
||||||
'ticket::_observer::_close_time',
|
'observer::_ticket::_close_time',
|
||||||
'ticket::_observer::_user_ticket_counter',
|
'observer::_ticket::_user_ticket_counter',
|
||||||
'ticket::_observer::_notification'
|
'observer::_ticket::_notification',
|
||||||
|
'observer::_tag::_ticket_history'
|
||||||
|
|
||||||
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
||||||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
||||||
|
|
|
@ -1,27 +1,5 @@
|
||||||
# Load the rails application
|
# Load the rails application
|
||||||
require File.expand_path('../application', __FILE__)
|
require File.expand_path('../application', __FILE__)
|
||||||
|
|
||||||
# load session helper
|
|
||||||
require 'session_helper'
|
|
||||||
|
|
||||||
# load module used to get current user for active recorde observer
|
|
||||||
require 'user_info'
|
|
||||||
|
|
||||||
# load omniauth strategies with database lookups api keys at runtime
|
|
||||||
require 'twitter_database'
|
|
||||||
require 'facebook_database'
|
|
||||||
require 'linked_in_database'
|
|
||||||
require 'google_oauth2_database'
|
|
||||||
|
|
||||||
# load notification factory (replace all tags)
|
|
||||||
require 'notification_factory'
|
|
||||||
|
|
||||||
# load lib
|
|
||||||
require 'gmaps'
|
|
||||||
require 'rss'
|
|
||||||
require 'cache'
|
|
||||||
|
|
||||||
require 'web_socket'
|
|
||||||
|
|
||||||
# Initialize the rails application
|
# Initialize the rails application
|
||||||
Zammad::Application.initialize!
|
Zammad::Application.initialize!
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
module OmniAuth
|
|
||||||
module Strategies
|
|
||||||
|
|
||||||
class FacebookDatabase < OmniAuth::Strategies::Facebook
|
class FacebookDatabase < OmniAuth::Strategies::Facebook
|
||||||
option :name, 'facebook'
|
option :name, 'facebook'
|
||||||
|
|
||||||
|
@ -15,6 +12,3 @@ module OmniAuth
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
module OmniAuth
|
|
||||||
module Strategies
|
|
||||||
|
|
||||||
class GoogleOauth2Database < OmniAuth::Strategies::GoogleOauth2
|
class GoogleOauth2Database < OmniAuth::Strategies::GoogleOauth2
|
||||||
option :name, 'google_oauth2'
|
option :name, 'google_oauth2'
|
||||||
|
|
||||||
|
@ -15,6 +12,3 @@ module OmniAuth
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
module OmniAuth
|
|
||||||
module Strategies
|
|
||||||
|
|
||||||
class LinkedInDatabase < OmniAuth::Strategies::LinkedIn
|
class LinkedInDatabase < OmniAuth::Strategies::LinkedIn
|
||||||
option :name, 'linkedin'
|
option :name, 'linkedin'
|
||||||
|
|
||||||
|
@ -15,6 +12,3 @@ module OmniAuth
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
module OmniAuth
|
|
||||||
module Strategies
|
|
||||||
|
|
||||||
class TwitterDatabase < OmniAuth::Strategies::Twitter
|
|
||||||
option :name, 'twitter'
|
|
||||||
|
|
||||||
def initialize(app, *args, &block)
|
|
||||||
|
|
||||||
# database lookup
|
|
||||||
# puts 'TwitterDatabase -> initialize'
|
|
||||||
config = Setting.get('auth_twitter_credentials') || {}
|
|
||||||
args[0] = config['key']
|
|
||||||
args[1] = config['secret']
|
|
||||||
super
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
15
lib/twitter_database.rb
Normal file
15
lib/twitter_database.rb
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
class TwitterDatabase < OmniAuth::Strategies::Twitter
|
||||||
|
option :name, 'twitter'
|
||||||
|
|
||||||
|
def initialize(app, *args, &block)
|
||||||
|
require 'Setting'
|
||||||
|
|
||||||
|
# database lookup
|
||||||
|
# puts 'TwitterDatabase -> initialize'
|
||||||
|
config = Setting.get('auth_twitter_credentials') || {}
|
||||||
|
args[0] = config['key']
|
||||||
|
args[1] = config['secret']
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in a new issue