speed up startup (avoid loading some gems on startup)

correct group permission leaks
add Discourse.cache for richer caching support
This commit is contained in:
Sam
2013-05-13 18:04:03 +10:00
parent 9b33e826f2
commit b6bf95e741
21 changed files with 250 additions and 66 deletions

View File

@ -1,3 +1,5 @@
require 'cache'
module Discourse
# When they try to do something they should be logged in for
@ -12,6 +14,9 @@ module Discourse
# When something they want is not found
class NotFound < Exception; end
def self.cache
@cache ||= Cache.new
end
# Get the current base URL for the current site
def self.current_hostname
@ -20,7 +25,7 @@ module Discourse
def self.base_uri default_value=""
if !ActionController::Base.config.relative_url_root.blank?
return ActionController::Base.config.relative_url_root
return ActionController::Base.config.relative_url_root
else
return default_value
end