Commit 0199949f authored by Maxwell Salzberg's avatar Maxwell Salzberg

move analytics to initializer, thx MrZYX

parent 5a0f948a
......@@ -49,19 +49,6 @@ Diaspora::Application.configure do
config.threadsafe!
require File.join(Rails.root, 'app/models/app_config')
if AppConfig[:google_a_site].present?
config.gem 'rack-google-analytics', :lib => 'rack/google-analytics'
config.middleware.use Rack::GoogleAnalytics, :tracker => AppConfig[:google_a_site]
end
if AppConfig[:piwik_url].present?
config.gem 'rack-piwik', :lib => 'rack/piwik'
config.middleware.use Rack::Piwik, :piwik_url => AppConfig[:piwik_url], :piwik_id => AppConfig[:piwik_id]
end
end
# Sacrifice readability for a 10% performance boost
Haml::Template::options[:ugly] = true
GC.enable_stats if GC.respond_to?(:enable_stats)
......
# Copyright (c) 2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
#hack to allow us to access app config, rather than putting in enviroments/production.rb
if Rails.env == 'production'
Diaspora::Application.configure do
if AppConfig[:google_a_site].present?
config.gem 'rack-google-analytics', :lib => 'rack/google-analytics'
config.middleware.use Rack::GoogleAnalytics, :tracker => AppConfig[:google_a_site]
end
if AppConfig[:piwik_url].present?
config.gem 'rack-piwik', :lib => 'rack/piwik'
config.middleware.use Rack::Piwik, :piwik_url => AppConfig[:piwik_url], :piwik_id => AppConfig[:piwik_id]
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment