Merge branch 'master' of github.com:diaspora/diaspora

This commit is contained in:
danielvincent 2010-08-23 17:01:03 -07:00
commit c7cd9792ae
3 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,4 @@
require 'lib/mongo_mapper/clear_dev_memory'
Diaspora::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
@ -17,5 +18,6 @@ Diaspora::Application.configure do
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
config.active_support.deprecation = :log
config.middleware.use MongoMapper::ClearDevMemory
#config.threadsafe!
end

View file

@ -7,7 +7,7 @@ max_conns: 1024
require: []
max_persistent_conns: 512
environment: production
environment: development
servers: 1
daemonize: true
#chdir: /usr/applications/localhash/current

View file

@ -0,0 +1,19 @@
module MongoMapper
class ClearDevMemory
def initialize(app)
@app = app
end
def call(env)
if Rails.configuration.cache_classes
else
MongoMapper::Document.descendants.each do |m|
m.descendants.clear if m.respond_to? :descendants
end
MongoMapper::Document.descendants.clear
MongoMapper::EmbeddedDocument.descendants.clear
end
@app.call(env)
end
end
end