From f2e596ec890ce855459c59169f8cf53befe83c06 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Sat, 19 Jan 2013 22:35:44 +0100 Subject: [PATCH] Preload also models --- config.ru | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.ru b/config.ru index 62261c2b..12cb49d8 100644 --- a/config.ru +++ b/config.ru @@ -7,8 +7,8 @@ $stdout.sync = true require 'travis/api/app' require 'core_ext/module/load_constants' -[Travis::Api, Travis, GH].each do |target| - target.load_constants!(:only => [/^Travis/, /^GH/], :skip => ['Travis::Memory', 'GH::ResponseWrapper'], :debug => true) -end +models = Travis::Model.constants.map(&:to_s) +only = [/^(ActiveRecord|ActiveModel|Travis|GH|#{models.join('|')})/] +Travis.load_constants! :only => only, :skip => ['Travis::Memory', 'GH::ResponseWrapper'], :debug => false run Travis::Api::App.new