Preload also models

This commit is contained in:
Piotr Sarnacki 2013-01-19 22:35:44 +01:00
parent 7bd90a4ef3
commit f2e596ec89

View File

@ -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